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? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -