I have this code that does not work with Firefox:
button.attr("name", i).on("click",function() {
var e = window.event;
var target = (e.target) ? e.target: e.srcElement;
alert(target.name);
});
I think the problem is in the event but I don’t know how to fix it.
The error message is:
[14:59:18.721] e is undefined @ http://127.0.0.1:8080/Tesi/javascript/Home.js:4202
Attaching a click handler in that way will result in the scope of the function being set to the button element itself. You could therefore replace the whole event.target section with either the jQuery:
or raw JavaScript: