Checkbox index
Is there a way to get an index of checkbox array?
I am filling a Checkbox from REST service and need to get an index of a clicked checkbox.
This is the code I used for Listview
var li = jQuery(this).closest("li");
var index = li.index('li:not([data-role="list-divider"])');
But is does not work when I change it for checkbox, I get index number that is + 2 than what is should be when clicked (fist item in array should be 0 but index is 2).
var li = jQuery(this).closest("input");
var index = li.index('input');
What am I doing wrong?