Select selection event
<HTML> <HEAD> <TITLE> New Document </TITLE> </HEAD> <script language = "JavaScript"> function addTktTypeRow () {var tbl = document. getElementById ('tkttypegrptable'); var rowsLen = tbl. rows. length var tr = tbl. insertRow (rowsLen); var cs = new Array (); var forSize = 2; for (var I = 0; I <forSize; I ++) {cs [I] = tr. insertCell ();} var I = 0; cs [I ++]. innerHTML = '<select onchange = "parentNode. nextSibling. lastChild. value = options [selectedIndex]. text "> <option> clear selection </option> <option value =" BBC "> A </option> <option value =" DHL "> B </option> <option value = "FBI"> C </option> <select> '; cs [I ++]. innerHTML = '<input type = "text" name = "tktTypeDesc" readOnly = "true"> ';} script <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 select all Note: If you need to introduce external Js, You need to refresh it to execute]
<HTML> <HEAD> <TITLE> New Document </TITLE> </HEAD> <script language = "JavaScript"> function addTktTypeRow () {var tbl = document. getElementById ('tkttypegrptable'); var rowsLen = tbl. rows. length var tr = tbl. insertRow (rowsLen); var cs = new Array (); var forSize = 2; for (var I = 0; I <forSize; I ++) {cs [I] = tr. insertCell ();} var I = 0; cs [I ++]. innerHTML = '<select onchange = "parentNode. nextSibling. lastChild. value = options [selectedIndex]. getAttribute (\ 'aaa \') "> <option> clear selection </option> <option aaa =" BBC "> A </option> <option aaa =" DHL "> B </option> <option aaa = "FBI"> C </option> <select> '; cs [I ++]. innerHTML = '<input type = "text" name = "tktTypeDesc" readOnly = "true"> ';} script <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 select all Note: If you need to introduce external Js, You need to refresh it to execute]