I have the following JSFIDDLE , which has a main image and image nav.
I need to wrap a div around the image nav so that i can position it with CSS.
How do i add the class to my HTML?
the question was not clear to me but you can use wrap
$('img ').wrap('<div class="newClass" />');
EDIT
$('img').filter(function(){return $(this).width()===40;})
.wrap('<div class="newClass" />');
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.