日期:2014-05-16 浏览次数:20354 次
<!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> <script type="text/javascript"> window.onload = function() { var oSelect = document.getElementById('bjbh'); var oHidden = document.getElementById('txt_bjbh'); oHidden.value = oSelect.options[oSelect.selectedIndex].innerHTML; oSelect.onchange = function() { oHidden.value = this.options[this.selectedIndex].innerHTML; } } </script> </head> <body> <form> <select id="bjbh" name="bjbh"> <option value="0">三一班</option> <option value="1">三二班</option> </select> <input type="hidden" name="txt_bjbh" id="txt_bjbh" /> </form> </body> </html>