为何JS编码无错,IE8浏览器无反映?新人请教
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style>
#div1.active {background:yellow;}
#div1 div {width:200px; height:200px; background:#ccc; border:1px;
solid #999;display:none;}
</style>
<script>
window .alond=function ()
{
var oDiv=document.getElementById('div1');
var aBtn=oDiv.getElementsByTagName('input');
var aBtn=oDiv.getElementsByTagName('div');
for(var i=0; i<aBtn.length; i++)
{
aBtn[i].index=i;
aBtn[i].onclick=function ()
{
for(var i=0; i<aBtn.length;i++)
{
aBtn[i].className='';
aDiv[i].style.display='none';
}
this.className='active';
aDiv[this.index].style.display='block';
};
};
};
</script>
</head>
<body>
<div id="div1">
<input class="active" type="button" value="教育"/>
<input type="button" value="培训"/>
<input type="button" value="招生"/>
<input type="button" value="出国"/>
<div style="display:block;">11111</div>
<div>22222</div>
<div>33333</div>
<div>44444</div>
</div>
</body>
</html>
<div>1111可以显示,其余<div>2.3.4.按纽不能点击选项转换显示.是不是浏览器的问题还是编码有问题?
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style>
#div1.active {background:yellow;}
#div1 div {width:200px; height:200px; background:#ccc; border:1px;
solid #999;display:none;}
</style>
<script>
window .alond=function ()
{
var oDiv=document.getElementById('div1');
var aBtn=oDiv.getElementsByTagName('input');
var aBtn=oDiv.getElementsByTagName('div');
for(var i=0; i<aBtn.length; i++)
{
aBtn[i].index=i;
aBtn[i].onclick=function ()
{
for(var i=0; i<aBtn.length;i++)
{
aBtn[i].className='';
aDiv[i].style.display='none';
}
this.className='active';
aDiv[this.index].style.display='block';
};
};
};
</script>
</head>
<body>
<div id="div1">
<input class="active" type="button" value="教育"/>
<input type="button" value="培训"/>
<input type="button" value="招生"/>
<input type="button" value="出国"/>
<div style="display:block;">11111</div>
<div>22222</div>
<div>33333</div>
<div>44444</div>
</div>
</body>
</html>
<div>1111可以显示,其余<div>2.3.4.按纽不能点击选项转换显示.是不是浏览器的问题还是编码有问题?
...全文
相关推荐
谷歌浏览器js打开IE浏览器.rar
通过js实现谷歌浏览器自动打开IE浏览器,压缩包里有教程和代码,火狐、360浏览器应该也可以,请自行尝试,本人实际项目中使用的谷歌浏览器
编码强化篇13|打造专业级TypeScript 开发体验
TS 是JS的一个类型,检查我们代码中可能会存在的一些隐形问题;同时可以使我们的编译器具备一些功能。如果我们使用(vue3官方脚手架工具)创建了项目,该项目基于且 TypeScript 已经准备就绪,可以直接进行TS开发。本篇文章,我们讨论的是,任意一个安装项目中(不使用脚手架),对TS的支持情况。
pdfjs预览插件,兼容IE浏览器
pdf预览插件,兼容IE浏览器
IE6、IE7、IE8浏览器下的CSS、JS兼容性对比
Internet Explorer 6中查看使用 Microsoft JScript 的网页,可能会遇到web浏览器速度较慢的性能问题。
完美解决IE9浏览器出现的对象未定义问题
下面小编就为大家带来一篇完美解决IE9浏览器出现的对象未定义问题。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧,祝大家游戏愉快哦



