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         } 

Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

java - How to create Table using Apache PDFBox -

mpi - Why is MPI_Bsend not returning error even when the buffer is insufficient to accommodate all the messages -