I have a div tag
<div id="theDiv">Where is the image?</div>
I would like to add an image tag inside of the div
End result:
<div id="theDiv"><img id="theImg" src="theImg.png" />Where is the image?</div>
I have a div tag
<div id="theDiv">Where is the image?</div>
I would like to add an image tag inside of the div
End result:
<div id="theDiv"><img id="theImg" src="theImg.png" />Where is the image?</div>
Have you tried the following:
$('#theDiv').prepend('<img id="theImg" src="theImg.png" />')
$("#theDiv").append("<img id='theImg' src='theImg.png'/>");
You need to read the documentation here.