Something like this will work: var newDiv = $('<div/>').appendTo( this.parentNode ).append( '<img/>' );
Karl 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 > discuss@jquery.com > http://jquery.com/discuss/ > _______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/