I have a html table and I'm trying to use jJavascript to trigger an event whenever a row loses focus but the "blur" event doesn't seem to be right as nothing is firing:
(quick example of what I'm doing)
<tr class="tableRow">
<td class="tg-amwm" contentEditable="true">hours</td>
<td class="tg-amwm" contentEditable="true">minutes</td>
<td class="tg-amwm" contentEditable="true">hours</td>
<td class="tg-amwm" contentEditable="true">minutes</td>
</tr>
and I"m using the following:
var rows = document.getElementsByClassName("tableRow");
for(i = 0; i < rows.length; i++) {
rows[i].addEventListener("blur", function(){console.log("row left!");});
}
but nothing is apprearing in the console - am I misunderstanding the event/DOM structure?