title: boolean variable in jquery
body: <p>I have some issues. I have checkbox in my jsp page. So if the checkbox is checked i have to set a boolean variable to true else false. I tried something like this </p>
  
  <pre><code>&lt;script&gt;
  $(document).ready(function() {
      $(".confirmCheckbox").change(function() {
          boolean confirmAssignee = false;
          $(this).attr("checked") {
              confirmAssignee = true;
          }
          alert(confirmAssignee);
      });
  });
  </code></pre>
  
  <p>But it is giving this error </p>
  
  <pre><code>SyntaxError: missing ; before statement
  $(this).attr("checked") {
  </code></pre>
  
  <p>I have mutliple checkboxes on the page.  Sample code is like this :</p>
  
  <pre><code>for loop(----)
  &lt;input type="checkbox" id="confirmBox-${loopCounter.index}" class = "confirmCheckbox"&gt;
  </code></pre>
  
  <p>Any help will be appreciated. Ask anything if required.</p>