Below you will find the features. It captures all input elements on the page and assigns keydown and keyup event handlers to each of them. If they find an apostrophe, it will call the preventDefault() method ..
function listen(event, elem, func) { if (elem.addEventListener) return elem.addEventListener(event, func, false); else elem.attachEvent('on' + event, func); } listen('load', window, function() { var inputs = document.getElementsByTagName('input'); for (var i = 0; i < inputs.length; i += 1) { keyHandler(i); } function keyHandler(i) { listen('keydown', inputs[i], function(e) { if (e.keyCode === 222) {
source share