Why doesn't the following code wrap the image with <li> tags and what would be the best way to do this?
var i = new Image
i.src = '/images/image.jpeg'
$(i).wrap('<li />')
$('div').html(i)
produces:
<div><img src="/images/image.jpeg"></div>
instead desired:
<div><li><img src="/images/image.jpeg"></li></div>