title: jQuery attr method failing to add attribute
body: <p>In certain conditions I want to open links in the same window, while in others I want to open them in a new window. I have the following jQuery code:</p>
  
  <pre><code>if (internal) {
      jQuery(".main a").removeAttr('target');
  } else {
      jQuery(".main a").attr('target', '_blank');
  }
  </code></pre>
  
  <p>I have two <code>&lt;a&gt;</code>s contained in the "main" div. One is directly under the div while the other is buried under a couple of sub-divs. When it runs, it only adds the blank target to the first <code>&lt;a&gt;</code> tag. However, when I set a breakpoint through Firebug and step through it, everything works fine. Is there a reason it wouldn't work at full speed? What's the workaround?</p>