title: Disable all links inside IFRAME using jQuery
body: <p>I want to disable all links inside an IFRAME, when people click on those link, alert would popup.</p>
  
  <p>Here is what I have so far, but the jQuery does nothing. Not sure what I did wrong.</p>
  
  <pre><code>&lt;iframe id='templateframe' name='templateframe' src="templates/template&lt;?php echo $templateID; ?&gt;/login.html"&gt;&lt;/iframe&gt;
  
  $(document).ready(function(){       
          $('#templateframe').contents().find('a').click(function(event) {
              alert("demo only");
  
              event.preventDefault();
  
          }); 
  });
  </code></pre>
  
  <p>Thanks in advance.</p>