资料
表格
制度
合同
管理
职场
经营
创业
范文
总结
计划
作文
文章
美文
词句
教程
模板
图片
字体
图标
办公
人事
财务
生产
管理资源吧首页
>>>
教程
>>>
编程
>>>
JavaScript教程
>>>
select选择事件问题
<HTML> <HEAD> <TITLE> New Document </TITLE> </HEAD> <img src="/_New/_cj/myeditor/sysimage/space.gif" class="ewebeditor__script" _ewebeditor_fake_tag="script" _ewebeditor_fake_value="%3Cscript%20language%3D%22JavaScript%22%3E%20%20%20%20%20%0D%0A%20%20%20%20%20function%20addTktTypeRow()%7B%20%20%20%20%20%20%20%20%20%20%20%20%20%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20var%20tbl%20%3D%20document.getElementById('tktTypeGrpTable')%3B%20%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20var%20rowsLen%20%3D%20tbl.rows.length%20%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20var%20tr%3Dtbl.insertRow(rowsLen)%3B%20%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20var%20cs%20%3D%20new%20Array()%3B%20%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20var%20forSize%20%3D%202%3B%20%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20for(var%20i%3D0%3Bi%20%3C%20forSize%3B%20i%2B%2B)%7B%20%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20cs%5Bi%5D%20%3D%20tr.insertCell()%3B%20%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%20%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20var%20i%3D0%3B%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%0D%0A%20%20%20%20%20%20%20%20cs%5Bi%2B%2B%5D.innerHTML%20%3D'%3Cselect%20onchange%3D%22parentNode.nextSibling.lastChild.value%3Doptions%5BselectedIndex%5D.text%22%3E%3Coption%3E%E6%B8%85%E9%80%89%E6%8B%A9%3C%2Foption%3E%3Coption%20value%3D%22BBC%22%3EA%3C%2Foption%3E%3Coption%20value%3D%22DHL%22%3EB%3C%2Foption%3E%3Coption%20value%3D%22FBI%22%3EC%3C%2Foption%3E%3Cselect%3E'%3B%20%20%20%20%20%20%20%20%20%0D%0A%20%20%20%20%20%20%20%20cs%5Bi%2B%2B%5D.innerHTML%20%3D'%3Cinput%20type%3D%22text%22%20name%3D%22tktTypeDesc%22%20readOnly%3D%22true%22%3E'%3B%20%0D%0A%20%20%20%20%20%20%20%20%7D%20%0D%0A%20%20%20%20%20%20%20%20%3C%2Fscript%3E"> <BODY> <input type="button" name="button" onclick="addTktTypeRow()" value="add"> <table id="tktTypeGrpTable" width=100% cellpadding="0" cellspacing="3"> <thead> <tr bgcolor="#FFFFFF"> <td class="tableHeader">Code</td> <td class="tableHeader">Description</td> </tr> </thead> </table> </BODY> </HTML>
[Ctrl+A 全选 注:
如需引入外部Js需刷新才能执行
]
<HTML> <HEAD> <TITLE> New Document </TITLE> </HEAD> <img src="/_New/_cj/myeditor/sysimage/space.gif" class="ewebeditor__script" _ewebeditor_fake_tag="script" _ewebeditor_fake_value="%3Cscript%20language%3D%22JavaScript%22%3E%20%20%20%20%20%0D%0A%20%20%20%20%20function%20addTktTypeRow()%7B%20%20%20%20%20%20%20%20%20%20%20%20%20%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20var%20tbl%20%3D%20document.getElementById('tktTypeGrpTable')%3B%20%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20var%20rowsLen%20%3D%20tbl.rows.length%20%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20var%20tr%3Dtbl.insertRow(rowsLen)%3B%20%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20var%20cs%20%3D%20new%20Array()%3B%20%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20var%20forSize%20%3D%202%3B%20%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20for(var%20i%3D0%3Bi%20%3C%20forSize%3B%20i%2B%2B)%7B%20%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20cs%5Bi%5D%20%3D%20tr.insertCell()%3B%20%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%20%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20var%20i%3D0%3B%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%0D%0A%20%20%20%20%20%20%20%20cs%5Bi%2B%2B%5D.innerHTML%20%3D'%3Cselect%20onchange%3D%22parentNode.nextSibling.lastChild.value%3Doptions%5BselectedIndex%5D.getAttribute(%5C'aaa%5C')%22%3E%3Coption%3E%E6%B8%85%E9%80%89%E6%8B%A9%3C%2Foption%3E%3Coption%20aaa%3D%22BBC%22%3EA%3C%2Foption%3E%3Coption%20aaa%3D%22DHL%22%3EB%3C%2Foption%3E%3Coption%20aaa%3D%22FBI%22%3EC%3C%2Foption%3E%3Cselect%3E'%3B%20%20%20%20%20%20%20%20%20%0D%0A%20%20%20%20%20%20%20%20cs%5Bi%2B%2B%5D.innerHTML%20%3D'%3Cinput%20type%3D%22text%22%20name%3D%22tktTypeDesc%22%20readOnly%3D%22true%22%3E'%3B%20%0D%0A%20%20%20%20%20%20%20%20%7D%20%0D%0A%20%20%20%20%20%20%20%20%3C%2Fscript%3E"> <BODY> <input type="button" name="button" onclick="addTktTypeRow()" value="add"> <table id="tktTypeGrpTable" width=100% cellpadding="0" cellspacing="3"> <thead> <tr bgcolor="#FFFFFF"> <td class="tableHeader">Code</td> <td class="tableHeader">Description</td> </tr> </thead> </table> </BODY> </HTML>
[Ctrl+A 全选 注:
如需引入外部Js需刷新才能执行
]
教程首页
更多教程