Есть ли способ доступа к идентификатору selectItem
JSF из JavaScript или jQuery?
<a:commandButton id="ajaxButton" value="change" onclick="selectCheck()">
</a:commandButton>
<h:selectManyCheckbox id="check" >
<f:selectItem id="myCheckbox" itemLabel="India" itemValue="India" />
<f:selectItem itemLabel="China" itemValue="China" />
<f:selectItem itemLabel="Germany" itemValue="Germany" />
<f:selectItem itemLabel="USA" itemValue="USA" />
</h:selectManyCheckbox>
Я пытаюсь получить доступ к идентификатору компонента, но он возвращает ноль:
function selectCheck() {
var obj = document.getElementById("myCheckbox");
alert(obj);
obj.checked=true;
}
Я хочу динамически проверять любые из этих флажков с помощью JavaScript или jQuery.