JSFiddle - React, Tailwind, and code Playground
HTML
<select id="email" multiple data-rel="chosen" class="input-xlarge" name="email[]">
<option value="[email protected]">[email protected]</option><option value="[email protected]">[email protected]</option>
<option value="[email protected]">[email protected]</option>
</select>
<br>
The selected would be in a input text below.
<br>
<input id="emailsend" class="emailKirim" name="emailKirim">
CSS
#email {
width: 60%;
}
#emailsend {
margin-top: 30px;
height: 60px;
width: 90%;
}
JavaScript
$("#email").on('change', function() {
var thisval = $(this).val() + '';
var myarr = thisval.split(',');
var newval = '';
myarr.forEach(function(i,v) {
newval += i + ' , ';
});
newval = newval.slice(0, newval.length - 3);
$("#emailsend").val(newval);
});