Currently, I am able to wrap an entire li-element in an ordered list with a link:
$(e).wrap('<a href="#" onclick="window.open(\'/xyz/\');return false;"></a>');
This is the HTML construct:
<li class="">
<img src="http://img.example.com/images/bdb/2474566/600x338.jpg" class="xx">
</li>
<li class="">
<img src="http://img.example.com/images/bdb/2474566/600x338.jpg" class="xx">
</li>
<a onclick="window.open('/something/');return false;" href="#">
<li class="">
<img src="http://img.example.com/images/bdb/2474566/600x338.jpg" class="xx">
</li>
</a>
I am looking for a way to wrap the link only around the image itself and not around the entire list element. How can I achieve this?