Question: How do I get the index of clicked item in the code below?

```
$('selector').click(function (event) {
    // get index in collection of the clicked item ...
});

```

With Firebug I saw this: `jQuery151017197709735298827: 2` (I've clicked in the second element).

Answer: 
This will alert the index of the clicked selector (starting with 0 for the first):

```
$('selector').click(function(){
    alert( $('selector').index(this) );
});

```
```
$('selector').click(function (event) {
    alert($(this).index());
});

```

[jsfiddle](http://jsfiddle.net/bCTAh/)