I have a few checkboxes in my form and I need to change their value when the checkbox is checked.
For example this is one of the checkboxes:
<input type="checkbox" name="drink" value=""/>
I know .val() can change it but I wasn’t able to do this with if statement.
I appreciate your answer in advance.
onchangeevent is the one you should be interested when it comes to checkboxes, as it fires whenever you change the checked state of it.checkedproperty determines whether or not the checkbox has been checked..val()method allows you to conveniently read/write element values.