Extract multiple data from DOM in jQuery - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:each

Description

Extract multiple data from DOM in jQuery

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-2.1.3.js"></script> 
  <script type="text/javascript">
    $(window).load(function(){/*  ww  w .j a  va2 s .  co m*/
var latLng = $('img').data();
$.each(latLng,function(index,value){
    console.log(value);
});
    });

      </script> 
 </head> 
 <body> 
  <img src="http://www.java2s.com/style/demo/Safari.png" data-latitude="?&quot;0&quot;" data-longitude="?&quot;0&quot;"> ?  
 </body>
</html>

Related Tutorials