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 Antworten
+ 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 .