Reputation: 47595
This will find everything within id="myID" that has class="myClass" and remove class="myClass":
$('#myID').find('.myClass').removeClass('myClass')
Q: Is there a shorter way of accomplishing the same thing? I just want to double check my syntax to make sure that I'm doing it the best way.
Upvotes: 0
Views: 33
Reputation: 30557
You can search descendants in the selector and not use find()
$('#myID .myClass').removeClass('myClass')
Upvotes: 2