You can check with the in operator:
"onpropertychange" in input
This function tester does not work in older versions of Firefox that report false event handler events for events corresponding to events, but this is not a problem because Firefox does not currently support the propertychange event and is unlikely to be in the future.
Here is some background: http://perfectionkills.com/detecting-event-support-without-browser-sniffing/
Another point: you need separate functions for handling propertychange and input events, because in the propertychange handler you need to check if this value property has changed. Otherwise, you will handle changes to any input property.
input.onpropertychange = function(evt) { evt = evt || window.event; if (evt.propertyName == "value") {
source share