JSFiddle - React, Tailwind, and code Playground
HTML
<select id="one">
<option id="one_val_a" value="one">one</option>
<option id="two_val_a" value="two">two</option>
<option id="three_val_a" value="three">three</option>
</select>
<span id="pin"></span>
<br/>
<span id="workspace"></span>
JavaScript
$('#one')
.clone(true, true) // perform the colne
.attr('id', '#two') // change the id
.appendTo('#pin') // append to #pin
.children() // get all options
.attr("id", function(i, value) { // processing on ids
// replacing last charecter with its next charecter
return value.replace(/[a-z]$/, function(char, index) {
return String.fromCharCode(char.charCodeAt(0) + 1);
});
});