You could do it like this, perhaps:

var $testDiv = $("<div class='testDiv'></div>").appendTo (window.document.body);

Is that what you're looking for?


--Karl
_________________
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On Aug 20, 2007, at 11:47 AM, Jay W wrote:


With the help from a few jQuery'ers, the only way to dynamically
create and append element using jQuery for multiframe application is

$(window.document.body).append("<div class='testDiv'></div>");

This jQuery statement returns window.document.body object.

There will be quite a few elements created this way in a same
document, it will be confusing to use array index to retrieve the
newly created element. So the question is: if I want to get that newly
created object directly, what's the correct way to do it?

Thanks.


Reply via email to