firefox中getElementById问题 5
代码:for(i=1;i<=display_outputContent_divs.length;i++){if(i==id){document.getElementByI...
代码:
for(i=1;i<=display_outputContent_divs.length;i++){
if(i==id){
document.getElementById("outputContent_channel"+i).style.display="block";
document.getElementById("chatPeople_channel"+i).style.display="block";
}
else{
document.getElementById("outputContent_channel"+i).style.display="none";
document.getElementById("chatPeople_channel"+i).style.display="none";
}
}
问题说明:IE显示正常
firefox报错,错误提示:document.getElementById("outputContent_channel" + i) has no properties
没看明白,能说的具体点么,正确的应该怎么写呢? 展开
for(i=1;i<=display_outputContent_divs.length;i++){
if(i==id){
document.getElementById("outputContent_channel"+i).style.display="block";
document.getElementById("chatPeople_channel"+i).style.display="block";
}
else{
document.getElementById("outputContent_channel"+i).style.display="none";
document.getElementById("chatPeople_channel"+i).style.display="none";
}
}
问题说明:IE显示正常
firefox报错,错误提示:document.getElementById("outputContent_channel" + i) has no properties
没看明白,能说的具体点么,正确的应该怎么写呢? 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询