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