2016-11-10 32 views

回答

1

按照HTML標準,每個表單元素必須有label重視它。您希望隱藏標籤的文字,您可以使用position:absolutelabel來隱藏lable的文字。因此,這裏是你的答案,

<input id="allotment" type="radio" name="allotdeallot" value="Allotment" /><label for="allotment">Allotment</label> 
<input id="de-allotment" type="radio" name="allotdeallot" value="De-Allotment" /><label for="de-allotment">De-Allotment</label> 

id of the input field必須用相同for attribute of the label

1

使用<label>標籤和id屬性添加到radio按鈕:

<input type="radio" name="allotdeallot" id="allotment" value="Allotment" /><label for="allotment">Allotment</label> 
<input type="radio" name="allotdeallot" id="deallotment" value="De-Allotment" /><label for="deallotment">De-Allotment</label> 

More information

相關問題