Sfwd favicon 152

Using Event.preventDefault() In Internet Explorer 8

Posted by Weston Ganger on July 01, 2015

Internet Explorer can be a major pain. Apparently event.preventDefault is not implemented in IE8. I know that IE8 is now no longer supported but I thought it would be useful to post this workaround anyways.

Anytime you want to use event.preventDefault() just replace it with this expression.


(event.preventDefault) ? event.preventDefault() : event.returnValue = false;


Related External Links:


Posted in Web Development and Tagged with internet-explorer 


Want me to help develop your next project or application?

Contact Us

Specializing in Ruby-on-Rails, Javascript, Multi-Platform Electron Desktop Apps and Hybrid Cordova Mobile Apps.

Recommended Posts