JSFiddle - React, Tailwind, and code Playground

by Aishwarya S

HTML

<table>
<tr>
	<div id="service">
		<tr>
			<td>Service Type:</td>
			<td><input type="text" name="servicetype" id="servicetype"></td>
		</tr>
		<tr>
			<td>Amount:</td>
			<td><input type="text" name="amount" id="amount"></td>
		</tr>
	</div>
</tr>
<tr>
	<td>
		<button id="addmore" onlick="duplicate()">Add More</button>
	</td>
</tr>
</table>

JavaScript

function duplicate() 
{
    var i = 0;
var original = document.getElementById('service');
	//alert("hi");
    var clone = original.cloneNode(true); // "deep" clone
    clone.id = "duplic" + ++i; // there can only be one element with an ID
   original.parentNode.appendChild(clone);
    //document.body.appendChild(clone);
}