我正在尝试为CheckedMultiSelect
中的每个复选框添加标题。
创建CheckedMultiSelect
的代码:
<select id="123" class="soria" dojoType="dojox.form.CheckedMultiSelect"
multiple="true" style="width:267px; height:260px;" onchange=""
store="listStore">
</select>
listStore
是来自json的dojo.data.ItemFileReadStore
。
如何将标题添加到复选框?
UPD。最后我收到了这样的HTML代码(多重选择的单个元素的源代码):
<div aria-selected="false" widgetid="dojox_form__CheckedMultiSelectItem_4"
id="dojox_form__CheckedMultiSelectItem_4"
class="dijitReset dojoxMultiSelectItem">
<div widgetid="dijit_form_CheckBox_4" role="presentation"
class="dijitReset dijitInline dojoxMultiSelectItemBox dijitCheckBox"
wairole="presentation">
<input aria-pressed="false" style="-moz-user-select: none;"
tabindex="0" id="dijit_form_CheckBox_4" value="on"
class="dijitReset dijitCheckBoxInput" dojoattachpoint="focusNode"
dojoattachevent="onmouseover:_onMouse,onmouseout:
_onMouse,onclick:_onClick"
type="checkbox">
</div>
<div class="dijitInline dojoxMultiSelectItemLabel"
dojoattachpoint="labelNode" dojoattachevent="onmousedown:_onMouse,
onmouseover:_onMouse,onmouseout:_onMouse, onclick:_onClick">
MICHAEL, DOPHINE
</div>
</div>
问题:如何指出dojo为此元素设置唯一标题?
答案 0 :(得分:0)
您可以添加一个随后更改标题的脚本,如
<script>
var o = document.getElementsByTagName('input');
for(var x in o){
// check if o[x].name is one of these and then
// do something with o[x].title ...
}
</script>