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) );
});

```
if you are using .bind(this), try this:

`let index = Array.from(evt.target.parentElement.children).indexOf(evt.target);`

```
$(this.pagination).find("a").on('click', function(evt) {
        let index = Array.from(evt.target.parentElement.children).indexOf(evt.target);

        this.goTo(index);
    }.bind(this))

```