0
CHOOSE 1 VALUE ON RADIOS
How can I choose one value in Two Input type="radio" in HTML and as a result, print that thing that I've chosen.
9 odpowiedzi
+ 4
You choose one value and not more in radio, and there may be as many choices as possible. For example, we will choose the gender we have only two sexes, male and female, and therefore you make two input. You have three apples: yellow, red, green, choose one, then there will be three input.
+ 4
Do you mean where you can see the data that the user selected?
+ 4
You don't have the name attribute in input; it should have the same name for radio; add name = "gender" to these two inputs. 10 and 11 line.
+ 3
Anna You are right. He didn't add name attribute that's why he is not able to select single value. And we can get selected value by attribute id.
+ 2
Johnny Deguzman Using document.getElementById('').innerHTML =
document.getElementById('').value;
0
Anna yeah, so If I do have 2 inputs in my HTML, for example the sexes, and I only choose "Male", how can I print it out on my HTML. Using Javascript.
0
Anna, please do visit and see my code. The "Basic Input"☺
0
Now I added the type name, and yes and I can choose now, so how can I print out the value that I've chosen...
Ps: I need Internet, poor Filipino kid <--- lol😅
- 1
name="value"attribute
name="all radio for similar value which you want"
<inlut name="selector" type="radio">
<inlut name="selector" type="radio">
<inlut name="selector" type="radio">