+ 5
How to append text to input radio button? [Solved]
Can we add text without adding another element? https://code.sololearn.com/Wm5PBpeRdiuf/?ref=app
5 ответов
+ 3
Use value attribute inside radio.
Whatever inside value will be shown.
<input type="radio" id="inp" value="option1"/>
+ 3
You can use label. But you will have to add another element
<input type="radio" id="male" name="gender" value="male">
<label for="male">Male</label><br>
+ 3
Steve Sajeev you are using HTML, that's not what I want, I am trying using javascript.
+ 2
inp.outerHTML= `<input type="radio" /> myRadioButton`;
0
Steve Sajeev using javascript, check the code, nevertheless value would not work as it's radio button