Push and reference key value pair using javascript - Javascript DOM

Javascript examples for DOM:Key Event

Description

Push and reference key value pair using javascript

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 w  w  w .  j av  a2s.com
var time = {
  "timetable": {
    "MONDAY": {
      "my0": {},
      "my1": {},
      "my2": {},
      "my3": {},
      "my4": {}
    }
  }
}
for(var i=0;i<5;i++)
  time.timetable.MONDAY["my"+i] = {}
    }

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

Related Tutorials