Refer object name as string - Javascript jQuery

Javascript examples for jQuery:String

Description

Refer object name as string

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="https://code.jquery.com/jquery-1.5.2.js"></script> 
      <script type="text/javascript">
    $(function(){/*ww w.  j  a  v a2 s . com*/
var markers = {};
markers.event = {
    click: function(event) {},
    drag: function(event) {}
};
$.each(markers.event, function(i, v) {
    console.log(i);
});
    });

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

Related Tutorials