title: Prime numbers up to n in JQuery
body: <p>I'm trying to make a program which prints prime numbers up to n. </p>
  
  <p>Here is my code, but it doesn't work.</p>
  
  <pre><code>$(document).ready(function(){
   $('#g').click(function(){ 
                  var n = $('#a').val();
                  for (a=2; a&lt;n; a++) {
                      for (i=2; i&lt;a; i++) {
                          if (a%i=0) {
                              break
                          }
                      } else {
                          var r = $('#r').html(); 
                          $('#r').html(r+'&lt;br /&gt;'+i); 
                      }
                  }
              }); 
          });    
  </code></pre>