高分悬赏!!急求!请问有没有类似与下图这样的三级联动源代码? 在线等,谢谢!
请问有没有类似与下图这样的三级联动源代码?在线等,谢谢,QQ,一六五零零五四二六六!!很捉急,谢谢!不要那种select那种的!...
请问有没有类似与下图这样的三级联动源代码?在线等,谢谢,QQ,一六五零零五四二六六!!很捉急,谢谢!不要那种select那种的!
展开
展开全部
写好了 给分吧
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script>
window.onload = function ()
{
var oSel = document.getElementById('sel');
var aSop = oSel.getElementsByTagName('option');
var oSelchild = document.getElementById('selchild');
var aCop = oSelchild.getElementsByTagName('option');
var oChildOptions = document.getElementById('childoptions');
for (var i = 0 ; i<aSop.length; i++)
{
aSop[i].onclick = function ()
{
if(this.value=='数码')
{
oSelchild.innerHTML = '<option value="电脑">电脑</option><option value="相机">相机</option>'
}
else if(this.value=='服装')
{
oSelchild.innerHTML = '<option value="长裤">长裤</option><option value="上衣">上衣</option>'
}
for(var i = 0 ; i<aCop.length; i++)
{
aCop[i].onclick = function ()
{
if(this.value=='电脑')
{
oChildOptions.innerHTML = '<option>联想</option><option>华硕</option>'
}
else if(this.value=='相机')
{
oChildOptions.innerHTML = '<option>三星</option><option>飞利浦</option>'
}
else if(this.value=='长裤')
{
oChildOptions.innerHTML = '<option>GXG</option><option>耐克</option>'
}
else if(this.value=='上衣')
{
oChildOptions.innerHTML = '<option>啄木鸟</option><option>阿迪达斯</option>'
}
}
}
}
}
}
</script>
</head>
<body>
<select multiple="multiple" id="sel" style="width:100px; height:100px;">
<option value="数码">数码</option>
<option value="服装">服装</option>
</select>
<select multiple="multiple" id="selchild" style="width:100px; height:100px;">
</select>
<select multiple="multiple" id="childoptions" style="width:100px; height:100px;">
</select>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script>
window.onload = function ()
{
var oSel = document.getElementById('sel');
var aSop = oSel.getElementsByTagName('option');
var oSelchild = document.getElementById('selchild');
var aCop = oSelchild.getElementsByTagName('option');
var oChildOptions = document.getElementById('childoptions');
for (var i = 0 ; i<aSop.length; i++)
{
aSop[i].onclick = function ()
{
if(this.value=='数码')
{
oSelchild.innerHTML = '<option value="电脑">电脑</option><option value="相机">相机</option>'
}
else if(this.value=='服装')
{
oSelchild.innerHTML = '<option value="长裤">长裤</option><option value="上衣">上衣</option>'
}
for(var i = 0 ; i<aCop.length; i++)
{
aCop[i].onclick = function ()
{
if(this.value=='电脑')
{
oChildOptions.innerHTML = '<option>联想</option><option>华硕</option>'
}
else if(this.value=='相机')
{
oChildOptions.innerHTML = '<option>三星</option><option>飞利浦</option>'
}
else if(this.value=='长裤')
{
oChildOptions.innerHTML = '<option>GXG</option><option>耐克</option>'
}
else if(this.value=='上衣')
{
oChildOptions.innerHTML = '<option>啄木鸟</option><option>阿迪达斯</option>'
}
}
}
}
}
}
</script>
</head>
<body>
<select multiple="multiple" id="sel" style="width:100px; height:100px;">
<option value="数码">数码</option>
<option value="服装">服装</option>
</select>
<select multiple="multiple" id="selchild" style="width:100px; height:100px;">
</select>
<select multiple="multiple" id="childoptions" style="width:100px; height:100px;">
</select>
</body>
</html>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询