<div class="htmlarea"> <textarea id="runcode6750"> <title>쿼리창</title> <form method="POST" onsubmit="return doSubmit(this)"> <fieldset style="margin:5px;width:630px;"> <legend> </legend>쿼리 조건<div align="center" class="inputblock" style="width:930;height:150;overflow:auto;"> <table border="1" width="900" cellpadding="0" cellspacing="0" class="table"> <tr> <td class="title" width="16%">列表框</td> <td class="title" width="16%">结果</td> </tr> </table> <table border="1" width="900" cellpadding="0" cellspacing="0" class="table"> <tbody id="tbl"> <tr> <td width="16%"> <select id="pid" name="project" onchange="changeValue(this)"> <option value=""></option> <option value="0">人员编号</option> <option value="1">姓名</option> </select> </td> <td width="16%"> <input id="result" type="text" value="" readonly> </td> </tr> </tbody> <tbody id="newTB"> </tbody> </table> </div> </fieldset> <div align="right" style="margin:10px;"> <input type="button" onclick="insertrow();" value="增加一行"> <input type="button" onclick="delerow();" value="删除一行"> </div> </form> </textarea> <br><input onclick="runEx('runcode6750')" type="button" value="运行代码"><input onclick="doCopy('runcode6750')" type="button" value="复制代码"> <input onclick="doSave(runcode6750)" type="button" value="保存代码"> <a href="http://www.jb51.net/article/23421.htm" title="查看具体详情" target="_blank">[Ctrl A 모두 선택 참고: </a>외부 J를 도입해야 하는 경우 실행하려면 새로 고쳐야 합니다 </div>]<script language="JavaScript"> function changeValue1(obj){ if(obj.value == 0){ document.getElementById("result").value = "f117"; }else { document.getElementById("result").value = "gaofei"; } } function changeValue(obj){ if(obj.value == 0){ obj.parentElement.parentElement.cells[1].children[0].value = "f117"; }else if(obj.value == 1){ obj.parentElement.parentElement.cells[1].children[0].value = "gaofei"; }else obj.parentElement.parentElement.cells[1].children[0].value = ""; } function insertrow(){ var newrow = document.all.tbl.rows[0].cloneNode(true); //克隆一行 document.all("newTB").appendChild(newrow); //添加刚才克隆的一行 } function delerow(){ var numrow = document.all("newTB").rows.length; if (numrow == 0) { alert("此行无法删除!"); return false;} document.all("newTB").deleteRow(numrow-1); } </script>