jquery - Rails 4 - Javascript - trouble with .not() -
can tell me wrong in javascript ?
it's supposed show alert "already opened" if there's plus (or) 2 pp div class "open".
if ($('pp').not('.closed')>=2) { window.alert('already opened'); }
jquery's not
function return jquery object, not integer.
i can't validate if rest of logic working if want number of dom elements matches jquery element, should using length
value:
if ($('pp').not('.closed').length>=2) { window.alert('already opened'); }
Comments
Post a Comment