How do you access the DOM node in jquery inside a javascript variable?
I have the following html
<div id="list_item_template"><li><a href="#">Text</a></li></div>
and javascript:
var item = $("#list_item_template").clone();
I want to access the internal tag of the <a>cloned copy and add the attribute. Without cloning, I would simply do:
$("#list_item_template a").attr("onclick", "SomeFunction()");
However, I need to perform this operation on the cloned copy, and not on the html located on this page. How should I do it?
+3