Basically as title says - I'm trying to switch checkbox's checked
value with an function that's being pinned to that checkbox as a onclick, and accepts this
<input type="checkbox" onclick="toggleCheckbox(this)" />
<script>
function toggleCheckbox(e)
{
e.checked = !e.checked;
}
</script>
But why the new value isnt negation of previous? its always T/F/T/F but it should be T/F/F/T/T/F/F as an console output
<input type="checkbox" onclick="toggleCheckbox(this)" />
<script>
function toggleCheckbox(e)
{
console.log(e.checked)
e.checked = !e.checked;
console.log(e.checked)
}
</script>