JSFiddle - React, Tailwind, and code Playground
HTML
<div id="DIV_country">
<div id="SELECT_country">
SELECT_country
</div>
</div>
<button id="add">
add
</button>
<button id="remove">
remove
</button>
JavaScript
var j = 0;
function add_country() {
j++;
var select = document.getElementById("SELECT_country");
var clone = select.cloneNode(true);
clone.setAttribute("id", "SELECT_country" + j);
clone.textContent = "SELECT_country" + j;
clone.setAttribute("name", "country" + j);
document.getElementById("DIV_country").appendChild(clone);
}
function remove_country() {
var select = document.getElementById('DIV_country');
if (select.children.length > 1) {
select.removeChild(select.lastChild);
}
}
document.getElementById('add').addEventListener('click', add_country, false);
document.getElementById('remove').addEventListener('click', remove_country, false);