I have a jQuery code as follows:
function changeSomething(event) {
var url = $(event.target).closest("form").attr("action");
}
My problem is $(event.target).closest("form").attr("action") is not reading the action attribute on IE (IE8) though it works perfectly on other browsers (i.e.: Chrome and Firefox). And I don’t have any tags named "action" or "submit". So this problem can’t be generated from it. Can anyone help me here?
Try to add this check to your code:
I am not sure if
event.targetis supported by IE8Hope this helps!