Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JS Is there a way to check if an event exists?

I am trying to detect if a certain webkit event 'webkitAnimationEnd' is supported by the browser, to do so I like to check if the event exists. But I can't seem to figure out how. Does anyone have a clue?

like image 638
Mark Avatar asked Apr 18 '12 17:04

Mark


Video Answer


1 Answers

Detecting event support without browser sniffing suggests that this ought to work:

'onWebkitAnimationEnd' in document.createElement('div');
like image 182
Matt Ball Avatar answered Oct 17 '22 02:10

Matt Ball