我正在使用jQuery提供自动完成并覆盖_renderItem
以呈现更多细节,但在尝试使用JAWS进行测试时,它似乎只读取data-value
属性中的值:
$("#UnitName").autocomplete({
...
create: function () {
$(this).data('ui-autocomplete')._renderItem = function (ul, item) {
return $('<li class="place-ac">')
.attr("data-value", item.value)
.append('<span class="placename">' + item.label + '</span> (<span class="postcode">' + item.postcode + '</span>)<span class="provider">' + place.organisation + '</span>')
.appendTo(ul);
}
},
minLength: 0,
});
导致此呈现的HTML:
<li class="place-ac ui-menu-item" data-value="61327" id="ui-id-148" tabindex="-1">
<span class="place-name">Rear Garden</span> (<span class="postcode">XX1 1XX</span>)<span class="provider">Cherry Orchard Garage</span>
</li>
JAWS将阅读61327
。有没有办法为JAWS指定一个额外的属性?