In a complex loop that is getting data from Facebook I have to add a blank div with class name out side of an img tag.How do I do that.
//Currently it's like the following
<img src="img" id="imageID"></img>
//Need to get it to following using jQuery
<div class="className"> <img src="img" id="imageID"></img> </div>
//Script
$(#imageID).prepend("<div">).addClass("className").append(</div>");
You have to wrap the ID-Selector into string literals and should use
$.wrap():Demo: http://jsfiddle.net/TimWolla/68L7d/