0

How to create switch button for gender male/female user?

I am searching about this I can't find clear codes about this in social media.

12th Sep 2022, 8:58 AM
edrielle lebarro
edrielle lebarro - avatar
2 Answers
+ 7
1️⃣ Using select : <select> <option value="" disabled selected>Gender</option> <option value="Male">Male</option> <option value="Female">Female</option> </select> 2️⃣ Using radio : <h4>Gender :</h4> <input type="radio" name="group1" value="male" id="a"/> <label for="a">Male</label><br> <input type="radio" name="group1" value="female" id="b"/> <label for="b">Female</label>
12th Sep 2022, 9:50 AM
Sujal
Sujal - avatar
+ 5
You could use input of type radio, as shown here: https://www.w3schools.com/tags/att_input_type_radio.asp
12th Sep 2022, 9:08 AM
Gabriele
Gabriele - avatar