[jQuery] Checkbox perpetually marked as checked
Hello,
I'm trying to write an if else statement in javascript so that when a
check box is checked, a table will appear, and when it is checked
again, another box will appear. However, the checkbox is constantly
marked as checked, and I do not know why. I did not set any checked
attritube to false or true. What gives?
function GetStoryPoints() {
var ownerCheck;
var creatorCheck;
if (document.getElementById("ownCheck").checked = true)
ownerCheck = true;
else
ownerCheck = false;
if (document.getElementById("createCheck").checked = true)
creatorCheck = true;
else
creatorCheck = false;
if (ownerCheck && creatorCheck) {
$.post('/StoryPoint/ListSpecific?retrieveOwned=' +
ownerCheck + '&retrieveCreated=' + creatorCheck + '&creatorID=' + $
("#UserList > option:selected").attr("value"), null, function(data) {
$("#storyPointDetail").html(data);
}, "html");
}
else if (ownerCheck && !creatorCheck) {
$.post('/StoryPoint/ListSpecific?retrieveOwned=' +
ownerCheck + '&retrieveCreated=' + creatorCheck + '&creatorID=' + $
("#UserList > option:selected").attr("value"), null, function(data) {
$("#storyPointDetail").html(data);
}, "html");
}
else if (!ownerCheck && creatorCheck) {
$.post('/StoryPoint/ListSpecific?retrieveOwned=' +
ownerCheck + '&retrieveCreated=' + creatorCheck + '&creatorID=' + $
("#UserList > option:selected").attr("value"), null, function(data) {
$("#storyPointDetail").html(data);
}, "html");
}
}