How do I check if an element is the last sibling?
For the last cell in a row I want to perform a different action.
This doesn\'t work:
$(\'td
If you want to select multiple elements which are different tags with a common point, (for ex: all data-foo attribute defined tags like divs, inputs, text areas, etc.) you can follow this code:
var elements = $("*[data-foo]");
elements.each(function (){
..
..your code
..
if (elements.index(this) == elements.length - 1) {
..you are at the end, do something else
}
})