On a click of a button I want to add additional table row and cells into a <table>
<input type="button" value="Add More" onclick="add_cust_fields()" />
table rows and cells here
<div id="extra_cust_field"></div>
rows and cells continue here
My JScode
function add_cust_fields() {
document.getElementById("extra_cust_field").innerHTML +=
"<tr><td>test</td><td>test2</td></tr>";
}
All I got was bare testtest2 above the entire table.
Change
to
and it should work.