Using the HTML 'label' tag with radio buttons

前端 未结 7 509
暗喜
暗喜 2020-12-28 12:07

Does the label tag work with radio buttons? If so, how do you use it? I have a form that displays like this:

First Name: (text field)
Hair Col         


        
相关标签:
7条回答
  • 2020-12-28 12:51

    You can't declare a label for a set of buttons, but for each button. In this case, the labels are "Mr.", "Mrs." and "Miss", not "Salutation".

    UPDATE
    Maybe you should just use another tag for this "label" of yours - since it's not really a label.

    <tr>
        <th align="right" scope="row"><span class="label">Activity:</span></th>
        <td>&#160;</td>
        <td align="left"><label><input type="radio" name="es" value="" id="es0" /> Active &#160;</label>
        [... and so on]
    </tr>
    
    0 讨论(0)
提交回复
热议问题