Friends I need to fill out a selection from a text box that is hosted in an input
the idea is to enter the txt_nameSector and be able to select that sector in the table next
As I understood, it requires filling a select
with text that you enter in input
, an example that served me is this:
An empty selection, plus an input and a button
$(document).ready(function () {
//Al hacer click se recupera el texto y se añade en el select
$("#btnSave").click(function () {
var texto = $('.frase').val();
$('.combo').append(new Option(texto));
});
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.2.3/jquery.min.js"></script>
<select class="combo">
</select>
<input type="text" class="frase">
<button id="btnSave">Save Click</button>