I have the following code, which through a select is concatenated the values selected in an input, what I require to do is to place the option chosen in a badge or pager since I want it to be easier to move from position any value that I was selecting from the select
$('#ddlVariables').change(function () {
if ($('#ddlVariables').val() != "") {
var textoInput = $('#txtFormula').val();
var total = $('#ddlVariables option:selected').text();
var nuevoTexto = textoInput + total;
$('#txtFormula').val(nuevoTexto);
}
});
<select id="ddlVariables">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="opel">Opel</option>
<option value="audi">Audi</option>
</select>
<input id="txtFormula" />