Question in <input> , the attribute value between radio & checkbox ā‰ļø? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
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 />

21st Mar 2021, 3:42 PM
Tarik HAMDOUNI
Tarik HAMDOUNI - avatar
2 Respostas
+ 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.
21st Mar 2021, 3:57 PM
Matias
Matias - avatar
+ 3
You can use any value for "value" attribute .even you can set value of radio type 1 & 2 .
21st Mar 2021, 3:52 PM
TOLUENE
TOLUENE - avatar