Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><strong>Updated answer</strong>:</p> <p><strong>Yes</strong>, you can feature-detect this. Create an element, listen for the event, and change an attribute on the element. In my tests, you don't even have to add the element to the DOM tree, making this a nice, contained feature detection.</p> <p>Example:</p> <pre><code>function isDOMAttrModifiedSupported() { var p, flag; flag = false; p = document.createElement('p'); if (p.addEventListener) { p.addEventListener('DOMAttrModified', callback, false); } else if (p.attachEvent) { p.attachEvent('onDOMAttrModified', callback); } else { // Assume not return false; } p.setAttribute('id', 'target'); return flag; function callback() { flag = true; } } </code></pre> <p><a href="http://jsbin.com/aqiwo3/6" rel="noreferrer">Live copy</a></p> <p>Firefox triggers the callback on all of the modifications above; Chrome on none of them.</p> <hr> <p><strong>Original answer</strong>:</p> <p>You can feature-detect whether <em>some</em> events are supported, as shown on <a href="http://kangax.github.com/iseventsupported/" rel="noreferrer">this handy page</a>. I don't know if you can test specifically for that one, but if you can, that code may well get you started.</p> <p><strong>Update</strong>: I <a href="http://jsbin.com/aqiwo3/3" rel="noreferrer">dumped Kangax's code into JSBin</a> and tried it, doesn't look like that sniffing technique works for that event (unless I have the name spelled incorrectly or something; Firefox is showing "false"). But my technique above does.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload