0
I’m having trouble sending the value of an input to another input readonly, my goal is to add the text that is in the first input in the other input by clicking the Add button, I’m currently testing with Javascript but I’m a bit new when it comes to this language.
This is my script:
$(".btnNomes").click(function () {
var nome = $(".inputNome");
$("#textNome").text(nome.val());
});
This is my code:
<div class="form-row"> <!--Nomes-->
<div class="form-group col-md-5">
<label for="inputNome">Nome</label>
<input type="text" name="inputNome" class="form-control" id="inputNome" placeholder="Nome">
</div>
<button type="button" id="btnNomes" name="btnNomes"class="btn col-md-1 mx-1 px-0 my-auto btn-danger">Add</button> <!--Btn Add-->
<input type="text" class="form-control col-md-5 my-auto" id="textNome" name="textNome" placeholder="Nomes..." readonly /> <!--Readonly Input-->
</div>
Thank you :)