title: Converting "document.getElementById" into jQuery
body: <p>I've been thinking/searching for an equivalent of the problem that I am having below, and nothing could be found. 
  Is there a way I can rewrite this to work with jQuery as an alternative?</p>
  
  <p><strong>First half of the code.</strong></p>
  
  <pre><code>&lt;a href="link.php?test=true" onclick="request(this)" target="_blank"&gt;
  
  &lt;a id="step2" href="javascript:alert('NOT FINISHED!');"&gt;
  </code></pre>
  
  <p><strong>Second half of the code.</strong></p>
  
  <pre><code>&lt;script language="javascript"&gt;
  var requests = 16;
  
  function request(self)
  {if(self.href != "#")
  requests -= 1;
  
  self.childNodes[0].src = "images/clear.gif";
  
  if(requests === 0)
  document.getElementById("step2").href = "next.php";}
  &lt;/script&gt;
  </code></pre>
  
  <p>Whereas I want to do a jQuery var request type thing. I want <code>onclick="request(this)</code> to work with my jQuery.</p>