[jQuery] What is the equivalent to Mootools $E(selector, data) in jQuery?
Hi. I'm porting a Mootools script to jQuery. Basically I need to
extract some data from existing data. In Mootools, I did it like this:
This creates a new element with some HTML :
tmpData = new Element('div').setHTML(htmlData);
This extracts all <li>*</li> from tmpData :
$E('li', tmpData ).injectInside($('el));
I tried :
jQuery('<div id="tmpData">'+data+'</div>');
jQuery('#tmpData').find('li').append('el');
which does not work for me because '+data+' contains the same elements
which are on the page. I feel that the extraction actually works (I
get no error message) but after being appended to the div 'tmpData'.
Can anyone point me in the right direction?
Thanks.