lets take for example two divs,
<div class="main right"></div>
<div class="main"></div>
And this jQuery snippet, as it follows:
$('.main').css('background-color','red');
This will change both divs background-color to red, as normal. I’d like to know how to change that color for the divs that have only “main” as class, not “main right”,
Or:
If had to more complicated conditions it can be done with
filterfunction:It will filter out the result of
.mainand maintain only element which theirdata-valueis 2 and theirinnerHTML.length < 50.If you don’t know what other classes could be to
mainbut you want the elements which has only themainclass.