Web Developers want to be able to detect when the user pressed the Cancel button in a search input. Currently there is no reliable way to detect this. I think firing an event makes sense. I would suggest firing a bubbling, non-cancelable "cancel" event from the input element. The following would be an example of usage: <input type="search" id="x"> <script> var elem = document.getElementById('x') elem.addEventListener('cancel', function(e) { alert('You Clicked Cancel!'); // e.target would be elem }, false); </script>
See also: bug 34393.
Since r63929, WebKit dispatches 'input' event immediately on the cancel button click, and will dispatch 'change' event when the focus is moved from the input field. I think this behavior is enough.
Agreed with comment 2.