I want to use prop()
to set the attribute of a checkbox to checked
.
When I use prop("checked",true)
I can visually see that the checkbox is checked, but if I look at the HTML there is no attribute value called checked
.
For example:
<input type="checkbox" class="my_class" checked>
is what I would expect to see after using prop("checked", true)
.
However, I don't see any change in the HTML code. I want to later reference whether or not the attribute checked
is set, but since there is not attribute called checked
in the HTML, then I'm unable to reference it.