javascript - Extract multiple data from DOM in jQuery? -


there node this

<img src=​"http:​/​/​x.jpg" data-latitude=​"0" data-longitude=​"0">​ 

in jquery, can extract 2 data attribute this:

a=node.data("latitude") b=node.data("longitude") 

i wondering whether there way extract multiple data attributes in 1 time, this:

latlng = node.data([latitude, longitude]) // not working 

latlng = node.data(); 

this return object

{    latitude:0,    longitude:0 } 

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

node.js - Using Node without global install -

php - CakePHP HttpSockets send array of paramms -