日期:2014-05-16 浏览次数:20406 次
<td> <input type="radio" name="region" value="south" checked="checked"/>南 <input type="radio" name="region" value="north"/>北 </td>
<select name="region3" id="options1" size="1"> <option value="竹">竹</option> <option value="海">海</option> <option value="丁">丁</option> </select>
$(".xiaoqu").change(function(){ });
------解决方案--------------------
<script type="text/javascript"> $(function () { $(":radio[name='region']").change(function(){ var option = $("#options1")[0].options; option[0].text = "东"; option[1].text ="西"; option.length = 2; }); }) </script>
------解决方案--------------------
<!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 type="text/javascript">
function init(){
var rs=document.getElementsByName("region");
for(var i=0;i<rs.length;i++){
rs[i].onclick=change;
}
}
function change(){
var se=document.getElementById("options1");
se.length=0;
if(this.getAttribute("value")=="south"){
var o1=new Option("竹","竹");
var o2=new Option("海","海");
var o3=new Option("丁","丁");
se[0]=o1;
se[1]=o2;
se[2]=o3;
}else{
var o1=new Option("东","东");
var o2=new Option("西","西");
se[0]=o1;
se[1]=o2;
}
}
window.onload=init;
</script>
</head>
<body>
<input type="radio" name="region" value="south" checked="checked"/>南
<input type="radio" name="region" value="north"/>北
<select name="region3" id="options1" size="1">
<option value="竹">竹</option>
<option value="海">海</option>
<option value="丁">丁</option>
</select>
</body>
</html>
这样试试
------解决方案--------------------
不用太复杂。简单的就Ok了。
<!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>