This will alert the index of the clicked selector (starting with 0 for the first):
$('selector').click(function(){
alert( $('selector').index(this) );
});
More Related Contents:
- How to get the children of the $(this) selector?
- jQuery Event Keypress: Which key was pressed?
- How do I get jQuery to select elements with a . (period) in their ID?
- What is the difference between the mouseover and mouseenter events?
- Difference between “change” and “input” event for an `input` element
- Resize event for textarea?
- How do you log all events fired by an element in jQuery?
- jQuery DOM changes not appearing in view source
- Testing if a checkbox is checked with jQuery
- Jquery: change event to input file on IE
- Preventing click event with jQuery drag and drop
- How do you check if a selector matches something in jQuery? [duplicate]
- Not class selector in jQuery
- jQuery single selector vs .find()
- Attach an event in a child iframe to a handler in the parent window
- Javascript with jQuery: Click and double click on same element, different effect, one disables the other
- jQuery: Unbind event handlers to bind them again later
- jQuery prevent change for select
- jQuery event that triggers after CSS is loaded?
- jQuery find and replace string
- Performance difference between jQuery’s .live(‘click’, fn) and .click(fn)
- jQuery support “:invalid” selector
- Capture event onclose browser
- List all javascript events wired up on a page using jquery
- jQuery: How to listen for DOM changes?
- Combine two selectors with one jQuery object
- Is there an equivalent to e.PageX position for ‘touchstart’ event as there is for click event?
- How to select empty inputs (value=””) using jQuery
- Fire oninput event with jQuery
- How to capture browser close event?