In Jquery how do you find out the 'eq' of an element of what is being clicked?
An easier alternative that does not require duplicating a selector is the following
$('#uploadChoice div').click(function(event) { var index = $(this).prevAll().length;});
You can add selectors as well, and pass "$(this)" as argument:
$(document).on('click', 'button.testbutton', function () { var index = $('div.example > div.xyz').find('button.testbutton').index($(this));});