Tuesday, 15 January 2013

javascript - How to check if two jQuery selectors have selected the same element -


Is there a way to challenge me that two jQuery selectors have selected the same exact element? I'm trying to loop on a set of divs and leave one of them. What I would like, something like this is:

  var $ rows, $ row, $ row_to_skip; $ Lines = $ ('line-square') $ row_to_skip = $ ('# skipped_row') $ .each ($ rows, function (id, line) {$ row = $ (line); if (! $ Row = = $ Row_to_skip) {// some things are here}};});    

You can pass the jQuery object in .not () :

  $ rows.Note ($ row_to_skip) .each (function () {...});    

No comments:

Post a Comment