title: Javascript Bookmarklet for Clicking Links With Specific Text
body: <p>A page has lots of links in it and I need to quickly click the links with text "Delete" in it.
  This causes AJAX request so a little pause is needed.
  What would be the javascript bookmarklet code (with no libraries, e.g. jQuery) which will quickly call the onclick() event binded to the links directly as an attribute but only those with text "Delete"?</p>
  
  <p>As far as I can do it myself I get:</p>
  
  <pre><code>javascript:
  (function(){
    var links = document.getElementsByTag('a');
    for(var i = 0; i &lt;= links.length; i++){
      if(links[i].innerHTML == "Delete"){
       setTimeout("links[i].onclick()", 500); // pause for previous AJAX to proceed
      }
    }
  })();
  </code></pre>