If I want to access a div with class ccc withing div with ID iii, I can do
$('#iii .ccc').doStuff();
But how do I access a div with class ccc within this div?
$('this .ccc').doStuff() doesn't seem to work. The context I'm trying to use it in is as follows:
$('.substitute').each(function () {
if (some condition) {
$('this .subcaptain').addClass('team_captain');
}
cnt++;
});
"some condition" is met (tested by logging to console) but the team-captain class isn't assigned.
The HTML is a bunch of DIVs with the following structure:
<div class='substitute'>
<div class='subcaptain'></div>
</div>