0

I just read somewhere that I can use:

"ontouchend" in document

as a way to detect whether the "touchend" event is available in that browser.

How can I tell which browsers support the "oneventname" in document expression?

1

1 Answer 1

0

{{ "x" in y }} is just a standard javascript expression for testing if a property exists in an object.

Most browsers do store a property on the document object for event handlers, but there are exceptions and important details to note.

See: http://perfectionkills.com/detecting-event-support-without-browser-sniffing/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.