I'm using jQuery and trying to append both an element and some text to an existing div element. However, when I try this
$('<img src="/img.png" />').appendTo(gMenuItemInnerDiv);
$(gMenuItemInnerDiv).text(name);
The img element from the first line is wiped out. How can I get both things into my div?