Can anyone assist me in wrapping an image within a div along with transferring the float setting?
This is my current code:
$('.photo-img').wrap('<div class="photo-wrap" />');
I would like the new div to inherit the float property from the image. Here is the HTML snippet:
<img class="photo-img" style="margin-left: 10px; margin-right: 0px; float: right; width: 200px; height: 267px;" src="path/to/image.jpg" alt="">
The desired outcome should be:
<div class="photo-wrap" style="float: right;">
<img class="photo-img" style="margin-left: 10px; margin-right: 0px; float: right; width: 200px; height: 267px;" src="path/to/image.jpg" alt="">
</div>
Any assistance on this matter would be greatly appreciated.
C