javascript - jQuery .data() to store id for later access? or other method? -


i trying append div body,

 $('<div>').appendto(document.body); 

however instead of giving div id attribute association can access later, use jquery.data() access div later actions can applied it.

 $('<div>').data('#myid').appendto(document.body); 

now how access later.

var later = $('<div>').appendto(document.body); // ... later.actions(); 

Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -