Interest in //Web //Win //Mobile //Database & //Life

Internet Explorer Object doesn’t support property or method ‘preventDefault’

I was working on a web page where I need to show or hide a div on button click using jquery, very simple code like below:

 

it was working fine in chorme browser, but in IE  I get the error like Object doesn’t support property or method ‘preventDefault’

at first I started thinking is it a problem of IE, but as Jquery is well established library I had to think that there is something wrong in my code, then I started checking and I found without passing the event object parameter in the function and I was calling event.preventDefault();

so the fixing was also very simple I just have to pass the event object as parameter…

 

Java ScriptJquery

Md Shiefuzzaman • April 24, 2013


Next Post

Shares