How to detect `focusin` support?
Thanks to Perfection kills , we can use the following JavaScript to detect event support: function hasEvent(ev) { var elem = document.createElement('a'), type = 'on' + ev, supported = elem[type] !== undefined; if (!supported) { elem.setAttribute(type, 'return;'); supported = typeof elem[type] === 'function'; } elem = null; return supported; } This works for about the only time I need it: detecting mouseenter support; hasEvent('mouseenter') will return false in Chrome, Firefox, etc., as it should. But now I'm trying to "fix" browsers that don't support the focusin and focusout events. According