JSFiddle - React, Tailwind, and code Playground
HTML
<html>
<head>
<title>clone</title>
</head>
<body>
<form action="">
<div class="test">
<label for="name">Name</label>
<input type="text" name="name">
<label for="email">Email</label>
<input type="text" name="email">
<label for="message">Message</label>
<textarea name="message"></textarea>
</div>
<a href="#" class="add_input">Add more</a>
</form>
</body>
</html>
CSS
label {display: block;}
JavaScript
(function(){
var input = $('.test').clone();
$('a.add_input').on('click', function(e){
$(this).before(input);
e.preventDefault();
});
})();