javascript - Firefox gives error for an event object -
this code works great on chrome, wont work on ie or firefox.
$('.modal').on("click", ".action", function() { if($(event.target).hasclass('added')) { if($(event.target).hasclass('remove_vehicle')) { //code }
i error on firefox console:
referenceerror: event not defined [break on error] if($(event.target).hasclass('added')) {
what wrong here? both event.trigger
, hasclass
supposed work on firefox.
try -
$('.modal').on("click", ".action", function(event) { // see difference in line if($(event.target).hasclass('added')) { if($(event.target).hasclass('remove_vehicle')) { //code }