I have a javascript event handler like this:
for (i = 0; i < x; i++){
var table = tableList[i];
var tableID = table.getAttribute('id');
var selector = table.querySelectorAll('input')[0];
selector.on('focusout', function(){
alert(tableID);
}):
}
The tableID alert is always the ID of the last table in the tableList, regardless of which table I am using.
Any ideas?