Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function addRow()
- {
- tabBody=document.getElementById("inputtable");
- row=document.createElement("TR");
- cell1 = document.createElement("TD");
- textnode1=document.createElement("input");
- textnode1.name="inputbox[]";
- textnode1.type="text";
- cell1.appendChild(textnode1);
- row.appendChild(cell1);
- tabBody.appendChild(row);
- }
- <form name="" action="" method="post">
- <table border="0" width="100%">
- <tbody id="inputtable">
- <tr><td><input type="text" name="inputbox[]" /></td></tr>
- </tbody>
- </table>
- <table border="0" width="100%">
- <tr>
- <td><input type="button" value="Add a Question" onclick="addRow();" /></td>
- </tr>
- </table>
- </form>
Add Comment
Please, Sign In to add comment