<!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=gb2312" />
<title>无标题文档</title>
<script language="javascript" type="text/javascript">
pattern1 = new Array();
pattern1[0]=["家具","jiaju"];
pattern1[1]=["玩具","wanju"];
pattern1[2]=["办公","bangong"];
pattern1[3]=["服装","fuzhuang"];
pattern2 = new Array();
pattern2[0]=["电影","dianying"];
pattern2[1]=["电视剧","dianshiju"];
pattern2[2]=["教育","jiaoyu"];
pattern2[3]=["综艺","zongyi"];
var category=new Array();
category[0]=["百货","baihuo",pattern1];
category[1]=["影视","yingshi",pattern2];
function categoryOption(){
for(i=0;i<category.length;i++){
var option=new Option(category[i][0],category[i][1]);
myForm.category.options[i]=option;
}
patternOption(0);
}
function patternOption(index){
while (myForm.pattern.length>0){
myForm.pattern.remove(0);
}
var arr=category[index][2];
for(i=0;i<arr.length;i++){
var option=new Option(arr[i][0],arr[i][1]);
myForm.pattern.options[i]=option;
}
}
</script>
</head>
<body οnlοad="categoryOption()">
<form name="myForm" method="post">
<select name="category" οnchange="patternOption(this.selectedIndex)">
</select>
<select name="pattern">
</select>
</form>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script language="javascript" type="text/javascript">
pattern1 = new Array();
pattern1[0]=["家具","jiaju"];
pattern1[1]=["玩具","wanju"];
pattern1[2]=["办公","bangong"];
pattern1[3]=["服装","fuzhuang"];
pattern2 = new Array();
pattern2[0]=["电影","dianying"];
pattern2[1]=["电视剧","dianshiju"];
pattern2[2]=["教育","jiaoyu"];
pattern2[3]=["综艺","zongyi"];
var category=new Array();
category[0]=["百货","baihuo",pattern1];
category[1]=["影视","yingshi",pattern2];
function categoryOption(){
for(i=0;i<category.length;i++){
var option=new Option(category[i][0],category[i][1]);
myForm.category.options[i]=option;
}
patternOption(0);
}
function patternOption(index){
while (myForm.pattern.length>0){
myForm.pattern.remove(0);
}
var arr=category[index][2];
for(i=0;i<arr.length;i++){
var option=new Option(arr[i][0],arr[i][1]);
myForm.pattern.options[i]=option;
}
}
</script>
</head>
<body οnlοad="categoryOption()">
<form name="myForm" method="post">
<select name="category" οnchange="patternOption(this.selectedIndex)">
</select>
<select name="pattern">
</select>
</form>
</body>
</html>