Access object item inside an array - Javascript Array Operation

Javascript examples for Array Operation:Associative Array

Description

Access object item inside an array

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(){// w  w  w  .ja v a2 s.com
var a = [{"response":"true","orderid":"30438","lineitemid":"34048"}];
var orderId = a[0].orderid;
document.write('<pre>'+orderId+'</pre>')
    }

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

Related Tutorials