Assigning data to an <li> element?
<p>I am generating some list items as a result of a search, and I want to attach some data to each list element from the search (possibly a bad idea to merge ui and data), but now curious about it. I am doing this:</p>

<pre><code>var element = $("&lt;li&gt;Hello&lt;/li&gt;);
element.mydata = "foo";
element.appendTo("#panelParent");
</code></pre>

<p>so I'm just assigning my stuff to element.mydata. My click handler reports that no such data exists for the element when clicked:</p>

<pre><code>$('#panelParent').delegate('li', 'click', function() {
    // this.mydata is undefined.
});
</code></pre>

<p>where did it go to? I could keep the data external to the a list item element, was wondering if there's a convenient way like this to just keep it bound though?</p>

<p>Thanks</p>
