title: Detecting a double-click on a Youtube URL with Javascript
body: <p>I want to be able to detect a double click on a <code>&lt;a&gt;</code> 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.</p>
  
  <p>I'm wondering what the best way to detect a double-click with Javascript is, other than changing all of the link markup to:</p>
  
  <pre><code>&lt;a href="http://youtube.com/whatever" ondblclick="checkIfYoutubeLink();"&gt;link&lt;/a&gt;
  </code></pre>
  
  <p>Something simular to:</p>
  
  <pre><code>$(a).dblclick(function() {
  </code></pre>
  
  <p>but without using jQuery or any Javascript library.</p>
  
  <p>Thanks.</p>