Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 149871

The not operator is not working correctly in jQuery

$
0
0

I want to get all div elements containing the class, edit-buttons, but not containing the class, hideElements. I have used the following jQuery. But it selects all divs containing the class, edit-buttons.

alert($("div#listView > div.edit-buttons").not(".hideElement").length);

enter image description here

Based upon the elements shown in the enclosed picture, only one div should be selected, instead all four divs are selected! I have even tried: alert($("div.edit-buttons:not(.hideElement)").length); But the result was the same!


Viewing all articles
Browse latest Browse all 149871

Trending Articles