How to find the binding tag index of a binding from an array using jquery ???
I want to search if there is an element that is eqqal for the clicked element, and if is true returns the index of this element.
I tried with something like this, but it came back with -1
$('#id').click(function(){ var obj = $('a').get(0).href; var arr = $.makeArray(obj); var getclickedhref = $(this).get(0).href; var clickedindex = $.inArray(getclickedhref, arr); console.log(clickedindex); });
Please help me!!
source share