title: jQuery Not selector causes infinite loop
body: <p>The following code causes my browsers to crash. For Firefox, i've been given an option whether or not i want to stop jQuery because it was running longer than it should be. </p>
  
  <pre><code>div id="divLeaving"&gt;
      You are about to leave to: &lt;span id="spanLeavingURL"&gt;&lt;/span&gt;
      &lt;a id="divLeavingYes" href="#"&gt;Yes&lt;/a&gt;&lt;a id="divLeavingNo" href="#"&gt;No&lt;/a&gt;
  &lt;/div&gt;
  &lt;a href="http://www.google.com"&gt;google&lt;/a&gt;
  
  &lt;script type="text/javascript" language="javascript"&gt;
  
      $(document).ready(function() {
          $("a:not(#divLeavingYes, #divLeavingNo)").click(function() {
              var url = $(this).attr("href");
              var test_if_local = url.indexOf("mycompany.com");
              if (test_if_local == -1) {
                  $("#spanLeavingURL").text(url);
                  $("#divLeavingYes").attr("href", url);
                  $("#divLeavingNo").click(function() { $(this).dialog('destroy'); });
                  $("#divLeaving").dialog({ modal: true });
                  return false;
              }
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>However, if i remove the not selector it doesn't crash my browser.</p>
  
  <pre><code>&lt;div id="divLeaving"&gt;
      You are about to leave to: &lt;span id="spanLeavingURL"&gt;&lt;/span&gt;
      &lt;a id="divLeavingYes" href="#"&gt;Yes&lt;/a&gt;&lt;a id="divLeavingNo" href="#"&gt;No&lt;/a&gt;
  &lt;/div&gt;
  &lt;a href="http://www.google.com"&gt;google&lt;/a&gt;
  
  &lt;script type="text/javascript" language="javascript"&gt;
  
      $(document).ready(function() {
          $("a").click(function() {
              var url = $(this).attr("href");
              var test_if_local = url.indexOf("mycompany.com");
              if (test_if_local == -1) {
                  $("#spanLeavingURL").text(url);
                  $("#divLeavingYes").attr("href", url);
                  $("#divLeavingNo").click(function() { $(this).dialog('destroy'); });
                  $("#divLeaving").dialog({ modal: true });
                  return false;
              }
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>How do i change thes query so it selects all  except for #divLeavingYes and #divLeavingNo?</p>