var newDiv = $("<div></div>").appendTo(this.parentNode);
$("<img ... />").appendTo(newDiv);
[untested]
I'm don't think you need to jQuerify this.parentNode before doing appendTo
on it, although might be wrong.
On 3/20/07, Allan Mullan <[EMAIL PROTECTED]> wrote:
Hey :-)
Just trying to work out how in jQuery you would do something like
(inside a function):
var newDiv = this.parentNode.appendChild(document.createElement("div"));
newDiv.appendChild(document.createElement('img'));
Because this is in a function I'm trying to append the items to the
object being passed (i.e. a parent div) using $('div').blah();
I'm having a complete mind blank so would appreciate any help.
I'm guessing it's using the append() functions etc??
Thanks in advance
Allan
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/
--
Rob Desbois
Eml: [EMAIL PROTECTED]
Tel: 01452 760631
Mob: 07946 705987
"There's a whale there's a whale there's a whale fish" he cried, and the
whale was in full view.
...Then ooh welcome. Ahhh. Ooh mug welcome.
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/