Question

There are two ways to associate an HTML <label> tag and its text with a form...

There are two ways to associate an HTML <label> tag and its text with a form element. Describe either one of them.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

There are two ways to associate an HTML <label> tag and its text with a form element

First ways to use <label> tag by providing the <input> and id attribute. The <label> tag needs a for attribute whose value is same as input id.

<label for = "student"> Student </label>

            <input type = "radio" name = "Occupation" id = "student" value = "student">

Second way to use label tag by, <input> tag use directly inside the <label> tag. In this case the for and id attributes are not needed because the association is implicit.

<label> Male    <input type = "radio" name = "gender" id = "male" value = "male">   </label>



Add a comment
Know the answer?
Add Answer to:
There are two ways to associate an HTML <label> tag and its text with a form...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT