我正在構建調查問卷,併爲問題提供了一個標籤,然後單擊用戶回答的單選按鈕。 問題文本添加了一個標籤,然後根據響應的數量(是/否/不確定,男性/女性)標記的單選按鈕被添加。 我的問題是,我也試圖保持可訪問性,我需要將問題文本標籤與單選按鈕相關聯。向單選按鈕添加標籤
帶有嵌套輸入(無線電)的標籤很好地關聯,帶問題的標籤是附加到該字段集的標籤。
我使用的WAVE工具欄基本符合可訪問性標準,但我似乎無法克服孤兒標籤錯誤。
<div>
<label for="{{question.UniqueID}}" compile="question.Text"></label>
</div>
<div>
<fieldset class="col-sm-6" id="{{question.UniqueID}}">
<label class="radio-inline" ng-repeat="responseOption in question.Responses">
<input type="radio"
name="{{question.QuestionID}}"
id="{{responseOption.UniqueID}}"
value="{{responseOption.ResponseOptionID}}"
ng-model="$parent.selectedOptionID"
ng-click="newValue(value, question, responseOption)">
{{responseOption.Text}} <!--Male/Female, yes/no/unsure-->
</label>
</fieldset>
由於輸入嵌套在標籤內,因此該標籤關聯的很好。我指的是另一個標籤,它應該與字段集關聯,但不是。我將編輯我的Q來指定。 – Mathemats