OK, this most probably is a rather dumb question but I am having difficulty wrapping my head around this...
On page load / generation I am adding checked="checked"
to my <input type="checkbox" value="1">
via PHP based on the actual database entry.
Upon acting with the form I am reading the input's checked status via Javascript / jQuery in order to (AJAX-)submit the form and update the database entry.
The issue is that even when my JS-evaluation _this.is(':checked')
returns false
the actual HTML / DOM representation still show the checked attribute <input type="checkbox" value="1" checked="checked">
.
I know that I could .removeAttr('checked')
but that doesn't make sense (everything works) and is also not recommended (see this SO question...)
My question(s) would be: Is this normal behaviour? Should I simply disregard the inconsistence? What am I not getting here?
Thanks for your time + effort!