2
使用JavaScript,我試圖改變列表框項目這樣的選擇:列表框selectedIndex屬性更改不會更新UI
function selectFirstActiveListItem(oListBox)
{
for (var i = 0; i < oListBox.options.length; i++)
{
oListBox.selectedIndex = i;
var szStatus = GetDomboBoxItemAttribute("Status", m_pdocConnectType.getXMLDOM(), oListBox);
if ("Enabled" == szStatus)
return;
}
oListBox.selectedIndex = 0;
}
雖然指數在後臺正確地更改,但它不是反映在用戶界面上。列表框仍然顯示舊的選擇。
怎麼回事?
此代碼是否會反映UI上的新索引選擇? – 2009-09-03 23:37:37