title: Code doesn't do anything when replacing Javascript with Jquery
body: <p>I have this javascript code:</p>
  
  <pre><code>var right = document.getElementById("true").checked;
  var wrong = document.getElementById("false").checked;
  
  if (right){
      answer += 100;
  }
  </code></pre>
  
  <p>I want to replace the Javascript with jQuery, so I replaced this line:</p>
  
  <pre><code>var right = document.getElementById("true").checked;
  </code></pre>
  
  <p>with this:</p>
  
  <pre><code>var right = $('#true')[0].attr('checked');  
  </code></pre>
  
  <p>I have also downloaded and added the jQuery file to my HTML:</p>
  
  <pre><code>&lt;script src="jquery-1.11.2"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>However when I replaced the above JS code with jQuery it isn't working at all. What am I doing wrong ?</p>
  
  <p><strong>EDIT:</strong> I have also tried this,</p>
  
  <pre><code>function calc(){
      $(function() {
          var isTrue = $('#true').attr('checked');    
      });
  
      var wrong = document.getElementById("false").checked;
  
      if (right){
          answer += 100;
      }
  }
  </code></pre>
  
  <p>But it is still not working.</p>