So I have this arrangement in my page:
<div class="food">
<div>
<a href="#" class></a>
<a href="#" class></a>
</div>
<div>
<a href="#" class></a>
<a href="#" class></a>
</div>
</div>
How do I add a class to all the a elements inside my div.food? What is the shortest and quickest way to implement this?
Thanks!
$('.food').find('a').addClass('myClass')
should be the fastest way in jquery. PS: edited, misreadadd a class to all the <a> elements
– Expertize