title: Undefined is not a function (jQuery add/remove class)
body: <p>I'm making a simple swap button which doesn't seem to work.</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;a onclick="paid(123);" class="no" id="123"&gt;&lt;/a&gt;
  &lt;a onclick="paid(124);" class="yes" id="124"&gt;&lt;/a&gt;
  &lt;a onclick="paid(125);" class="no" id="125"&gt;&lt;/a&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>JAVASCRIPT</strong></p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function paid(currentId) {
  
  if (document.getElementById(currentId).hasClass("no")) {
      document.getElementById(currentId).removeClass( 'no' ); 
      document.getElementById(currentId).addClass( 'yes' );   
  }
  
  else if (document.getElementById(currentId).hasClass("yes")) {
      document.getElementById(currentId).removeClass( 'yes' );    
      document.getElementById(currentId).addClass( 'no' );    
  }
  
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>Am I missing something obvious here? :)</p>