title: Javascript / Jquery script terminated by timeout
body: <p>So as a python guy I am experimenting with JS and Jquery. I wrote this small script to fold \ unfold a menu bar on a html page using Jquery slide. I believe this should work fine, however all it does is freezing my browser for around 10 secs after which in the console I get "script terminated by timeout". Anyone can point me in the right direction?</p>
  
  <pre><code>$(document).ready(function(){   
      var Clicked = false; 
      while (true) {
      if (Clicked) {
          $("button").click(function(){
              $("#menu").slideDown();
              $("button").replaceWith("&lt;button type=\"button\"&gt;&amp;#8593;&lt;/button&gt;");
              Clicked = false;  
          });
       } else {
           $("button").click(function(){
               $("#menu").slideUp();
               $("button").replaceWith("&lt;button type=\"button\"&gt;&amp;#8595;&lt;/button&gt;");
               Clicked = true;  
           });
       }
      }
  });
  </code></pre>