Auto fill input boxes with data from JSON - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Form Event

Description

Auto fill input boxes with data from JSON

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
    window.onload=function(){/*from   ww w.j  a  v a2  s  . c o m*/
obj = [{"customer_phone_number":"123456789","id":"2","customer_name":"Joe","customer_address_1":"3811"}];
console.log(obj['customer_name']); // old way
console.log(obj[0]['customer_name']); // new way
    }

      </script> 
   </head> 
   <body>  
   </body>
</html>

Related Tutorials