Javascript examples for jQuery:String
Refer object name as string
<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>