JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
<div class="st-box">
<input type="text" id="search1" name="ref_name[]" class="st-reg-step2 no-line" placeholder="Please."/>
</div>
<span id="add-btn">Add+</span>
<button id="remove-btn">
Удалить
</button>
CSS
#remove-btn {
display: none;
}
JavaScript
$('#add-btn').click(function(){
$(this).prev(".st-box").clone().insertBefore(this);
$('#remove-btn').show();
console.log($('.st-box').length);
})
$('#remove-btn').click(function(){
if( $('.st-box').length > 1 ){
$('.st-box').last().remove();
}
if( $('.st-box').length < 2 ){
$('#remove-btn').hide();
}
})