Необходимо оценивать против проверенного свойства элемента флажка.
for (i=0; i<arrChecks.length; i++)
{
var attribute = arrChecks[i].getAttribute("xid")
if (attribute == elementName)
{
// if the current state is checked, unchecked and vice-versa
if (arrChecks[i].checked)
{
arrChecks[i].checked = false;
} else {
arrChecks[i].checked = true;
}
} else {
arrChecks[i].checked = false;
}
}
Я думаю, что правильный способ:
«9» .charCodeAt (0)
или stringInstace.charCodeAt (charIndex), где charIndex - целое число