Once click cell it need to show the combo box

bijan

New Member
-->One click on Try it button it iwll add a row and once click on first cell it need show the combo box i am like this\[code\]<script>function myFunction() { str=document.getElementById('mytable').innerHTML; newstr='<tr><td onclick="myCheck()"><input type="text" name="FirstName"></td><td><input type="text" name="FirstName"></td></tr>'; document.getElementById('mytable').innerHTML=str+newstr;}function myCheck(){ var table = document.getElementById("mytable"); var currentCell //on which click action perfoemed click action perform var element4 = document.createElement("select"); var option1 = document.createElement("option"); option1.value="http://stackoverflow.com/questions/15658159/1"; option1.innerHTML="sample1"; element4.appendChild(option1); var option2 = document.createElement("option"); option2.value="http://stackoverflow.com/questions/15658159/2"; element4.appendChild(option2); currentCell.insert(element4); } </script> <table border="1" id="mytable"> <tr> <td><tr><td><input type="text" name="FirstName"></td> <td><tr><td></td> </tr> <tr> <td><tr><td></td><td><input type="text" name="FirstName"></td> </tr> </table> <button onclick="myFunction()">Try it</button> \[/code\]
 
Back
Top