+ 5
what does value do in this code?
<input type="checkbox" name="gender" value="1" /> Male <br /> <input type="checkbox" name="gender" value="2" /> Female <br /> without value this code is working fine, so why do I use value? one more thing is, nothing happening while I am changing the number of value.
1 Réponse
+ 6
The "value" is useful when you want user's choice.
For example:
$("input[name=gender]:checked").val() -> returns the value of your checkboxes!