一个JS组合下拉菜单的问题,请高手指点。

我再LB论坛里考出了一段代码:http://211.140.206.134/hcy/aaa.html ,实现了选择省份之后城市也相应的跟着改变,然后旁边的框里面也有了相应的值,但是我现在想得到城市与省份的value的值(比如:

1<option value="beijing">北京</option>

),但是这个js文件里面没有定义value值,如果我想添加上应该怎么改动?请高手帮忙!!!!!
---------------------------------------------------------------

 1<form method="post" name="fm">
 2<select name="a" onchange="chg(selectedIndex)">
 3<option>亚洲   
 4<option>欧洲   
 5<option>美洲   
 6</option></option></option></select>
 7<select name="b" onchange="r.value=value">
 8<option>请选择   
 9</option></select>
10<input id="r" name="r"/>
11</form>
 1<script>   
 2var arr=[["中国","日本","朝鲜","新加坡"],["英国","法国","意大利"],["美国","加拿大","巴西"]]   
 3function chg(i){   
 4with(document.fm.b){   
 5length=0;   
 6for(j=0;j<arr[i].length;j++)   
 7options.add(new Option(arr[i][j],arr[i][j]))   
 8document.fm.r.value=value+document.fm.a.value   
 9}   
10}   
11chg(0)   
12</script>
Published At
Categories with Web编程
Tagged with
comments powered by Disqus