javascript - associate an object with each html element object -
javascript - associate an object with each html element object -
i have list of user. each user contains info name, lastly name, dob , lots more. have 1 div
each user. div
display name , edit button within it. when user click on edit button want display rest of detail. can done storing object in hidden field , can utilize .data()
. wanted done different way 1 saw in d3 library.
in d3 tree view each node hold object, can object this
keyword. dont know how done it. way done it.
few lines code.
var node = $(this); obj = node.context.__data__;
i using contextmenu jquery custom right click menu. when right click on node above given line giving me every details.
i wanted same html page. each div hold unique object contains details , should able details.
i have accomplish below given code. wanted confirm right way it
$('div').each(function(){ this.data={"name":"david","email":"david@gmail.com"} })
javascript jquery d3.js contextmenu
Comments
Post a Comment