I want to be able to detect a double click on a <a>
tag and then if it matches a particular regex pattern, run a function. In this case I will be checking if the link being clicked on is a valid link to a Youtube video.
I'm wondering what the best way to detect a double-click with Javascript is, other than changing all of the link markup to:
<a href="http://youtube.com/whatever" ondblclick="checkIfYoutubeLink();">link</a>
Something simular to:
$(a).dblclick(function() {
but without using jQuery or any Javascript library.
Thanks.