This article describes quite a robust way of detecting the event support itself - as your case is yet another one when it's different from the feature support.
Basically, one has to test a corresponding property (onsearch
for search
event, for example) of the corresponding elements. Like...
'onsearch' in document.documentElement; // true in Chrome, false in Firefox/Opera
It's noted in the article that Firefox will fail the check if it's done on the wrong element, but I actually found only Opera behaving that way:
'onchange' in document.documentElement; // false in Opera, true in Firefox/Chrome
'onchange' in document.createElement('input'); // true in Opera too
As a final resort, one can attempt to assign a handler for this element, then check this property again:
var el = document.createElement('input');
el.setAttribute('onsearch', 'return;');
typeof el.onsearch; // 'function' in Chrome, 'undefined' in Firefox/Opera