<div class="element"></div>
<div class="element"></div>
<div class="element active"></div>
<div class="element active"></div>
<div class="element active"></div>
<div class="element"></div>
$('.element').on('click', function () {
console.log($(this).index('.active'));
});