0
Question in <input> , the attribute value between radio & checkbox âïž?
In the checkbox type they used value="1" & value="2" <input type="checkbox" name="gender" value="1" />Male <br /> <input type="checkbox" name="gender" value="2" />Female <br /> But in radio type they used a vlue="male" & value="female" <input type="radio" name="gender" value="male" />Male <br /> <input type="radio" name="gender" value="female" />Female <br />
2 RĂ©ponses
+ 4
Tarik HAMDOUNI The value attribute for <input> element in HTML is used to specify the initial value of the input element. It has different meaning for different input type:
The âbuttonâ, âresetâ and âsubmitâ property specifies the text on the button.
The âtextâ, âpasswordâ and âhiddenâ property specifies the initial value of the input field.
The âcheckboxâ, âradioâ and âimageâ property specifies the value associated with the input.
+ 3
You can use any value for "value" attribute .even you can set value of radio type 1 & 2 .