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
Post a Comment