So I want to add a class to all the images within particular <div>
using javascript.
I have made this code that adds a class to all the images in the webpage:
$(function(){
$('img').addClass('posts');
});
But i want to add it only for a particular <div>
.
And I need a different version that excludes the images from adding class within a <div>
How is it possible?