Hi John

Thanks for your reply.

I did: jQuery(el).append(jQuery(data).find('li')); which works as
well.

Greetings, Pete

On Jun 24, 7:21 pm, "John Resig" <[EMAIL PROTECTED]> wrote:
> You could do this:
>
> jQuery('<div/>').html(data).find('li').appendTo('#el');
>
> --John
>
> On Tue, Jun 24, 2008 at 6:44 AM, Toxane <[EMAIL PROTECTED]> wrote:
>
> > 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.

Reply via email to