I have the following code:
$('#commentContainer').delegate('div.comment-vote div.vote', 'click', function () {
//etc
}
I want this to get called but not when the div.vote also has a class “unauthenticated”
how can i do that?
<div class="vote"></div>//this one when clicked call click function in delegate
<div class="vote unauthenticated"></div>//this one do nothing.
Use the
not-selector[docs].Now the
clickevent will trigger the handler only ondiv.voteelements that do not have theunauthenticatedclass.