<!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> <mce:script src="jquery-1.3.2.js" mce_src="jquery-1.3.2.js"></mce:script> <mce:script type="text/javascript"><!-- $(document).ready(function(){ }); function test(){ for(var i = 1;i<4;i++){ var temp_a = "#a1" +i; var temp_b = "#b1" +i; var temp_c = "#c1" +i; if($(temp_a).is(":selected")){ $(temp_b).attr('selected',true); $(temp_c).attr('selected',true); } } } function setSelected(o){ document.getElementById("b1").selectedIndex=o.selectedIndex; document.getElementById("c1").selectedIndex=o.selectedIndex; } // --></mce:script> </head> <body> <select name="a" id="a1" οnchange="setSelected(this)"> <option selected="selected">请选择</option> <option id="a11" value="第一个a">第一个a</option> <option id="a12" value="第二个a">第二个a</option> <option id="a13" value="第三个a">第三个a</option> </select> <select name="b" id="b1"> <option selected="selected">请选择</option> <option id="b11" value="第一个b">第一个b</option> <option id="b12" value="第二个b">第二个b</option> <option id="b13" value="第三个b">第三个b</option> </select> <select name="c" id="c1"> <option selected="selected">请选择</option> <option id="c11" value="第一个c">第一个c</option> <option id="c12" value="第二个c">第二个c</option> <option id="c13" value="第三个c">第三个c</option> </select> </body> </html>