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
<script>
$(document).ready(function() {
$(".confirmCheckbox").change(function() {
boolean confirmAssignee = false;
$(this).attr("checked") {
confirmAssignee = true;
}
alert(confirmAssignee);
});
});
But it is giving this error
SyntaxError: missing ; before statement
$(this).attr("checked") {
I have mutliple checkboxes on the page. Sample code is like this :
for loop(----)
<input type="checkbox" id="confirmBox-${loopCounter.index}" class = "confirmCheckbox">
Any help will be appreciated. Ask anything if required.
var, instead ofboolean