How can i add the class selectors dynamically to the img
tag. For Example:
img tag should be inside the anchor tag then only the class name:sample should add dynamically whichever anchor tag contain img like,
Before:
<a href="image.png"><img src="image.png"/></a>
After:
<a href="image.png"><img src="image.png" class="sample"/></a>
If already image tag contain class then remove that class and the new class is possible in jquery. I am not sure, how can i do this in jQuery. Any suggestion would be great.
Thanks, vicky