I have the following structure:
<div class="eventIcons">Sample Event</div>
How do I add an tag to the div before the text so that I end up with:
<div class"eventIcons"><img id="printOnlyIcon" src"printOnly.jpg"/>Sample Events</div>
I am currently using the following jquery but its adding the tag after the text:
$('div.eventIcons').append('<img id="printOnlyIcon" src="printOnly.jpg"/>');
Many Thanks
Use
.prependto add element at the beginning.See below,