-1
Hello, I would like to change the value of the Hidden input. The input I want to change has id = Type. I want to change as soon as I click on the Type 2 link, I want to change its value to 2. How I can do this?
<script src="https:/ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<label id="lb1">Nome: </label>
<input type="text" id="ip1" placeholder="Digite seu Nome" required autofocus/>
<br>
<label id="lb2"> Sobrenome: </label>
<input type="text" id="ip2" placeholder="Digite seu Sobrenome" required/>
// <a href="javascript: fTipo1()">tipo 1</a>
//<a href="javascript: fTipo2()">tipo 2</a>
<input type="hidden" id="Tipo" value="1"/>
<script>
function fTipo1(){
var Nome = $("#ip1").val();
var Tipo = $("#Tipo").val();
window.location.href="href.php?Nome="+Nome+"&Tipo="+Tipo;
}
function fTipo2(){
$('#Tipo').change(function(){
$('2 > #Tipo').val($(this).val());
alert($("#Tipo").val());
});
}
</script>
Thank you very much, guys!!!
– Thiago Robles