I would like to wrap a particular <img>
in a <span>
and also apply a class to that <span>
.
Here is the relevant code:
<img id="wrapped-image" alt="" src="">
For some reason, the following is not working:
<script>
$( '#wrapped-image' ).wrap( '<span class="jquery-wrapped"></span>' );
</script>
Additional Information
The image in question is the (somewhat notorious) smiley used by Jetpack for statistics purposes. It can be seen on this site: http://barristerbeverages.com/. The javascript, supra, is also present on that site, implemented immediately after the Jetpack smiley (just view source).