I am trying to have some inputs for my users, and I want them to be able to hit a button to add another row of inputs. I am trying to use jQuery to add a list of inputs after the first.
Here is what I have tried so far:
$("#addButton").on("click", function() {
$("#inputs").append($("#linear"));
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="inputs">
<ul class="linearFeetCalc" id="linear">
<li><input type="number" placeholder="Quantity" id="quantity"></li>
<li><input type="number" placeholder="Length" id="length"></li>
<li><input type="number" placeholder="Width" id="width"></li>
<li><input type="number" placeholder="Height" id="height"></li>
<li><input type="checkbox" id="stackable"> Stackable?</li>
<li><input type="checkbox" id="turnable"> Turnable?</li>
</ul>
</div>
<button id="addButton">Add Item</button>