[jQuery] Feature Request for $(expr, context)
Hi,
$(expr, context) is a really nice function, but it could be optimized.
Until now, it can only be used, if context is a dom tree. But see this
scenario:
var html='';
html += "<ul>";
for (var i=0; i<10;i++) {
html += "<li>listing "+i+"</li>";
}
html+='</ul>';
Now, it would be great, if you could apply every jQuery function like
$('li',html).css("color", "red");
Until know, I have to create a dom element like
$('body').append('<div id="helper"></div>');
$('#helper').html(html);
$('#helper li',html).css("color","red");
html = $('#helper').html();
$('#helper').remove();
That does not look good at all. Is there a way to realize this
behaviour in jQuery-Core?
Mathias
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/