Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

How to add a label inside the division for Gender field.

<div>
<label for="gender">Gender</label><br/>
<input type="radio" name="gender" id="male" />
<label for="male">Male</label><br/>
<input type="radio" name="gender" id="female" />
<label for="female">Female</label><br/>
<input type="radio" name="gender" id="other" />
<label for="other">Other</label><br/>
</div><br/>.
I use this code but i still not working
by

1 Answer

iamabhishek
Don't use the 'for' and 'id' attribute in the <label> and <input> tags.
Try this code:

<div>
<label>Gender</label><br/>
<input type="radio" name="gender" />
<label>Male</label><br/>
<input type="radio" name="gender" />
<label>Female</label><br/>
<input type="radio" name="gender"/>
<label>Other</label><br/>
</div><br/>

Login / Signup to Answer the Question.