This code corresponds to the JavaScript code:
<script type="text/javascript">
$(document).ready(function() {
var Id = document.getElementsByName("rama");//ESTA ES LA FORMA QUE USO
let activoFijo = $('input[name="activoFijo"]:checked').val();//ESTA LA ENCONTRE COMO RESPUESTA A OTRA PREGUNTA SIMILAR A ESTA
$.post("../Sql/ArregloPersonas.php", {Id: Id
}, function(){
$("#personas-rama").html();
});
});
</script>
The second part of the code contains the radio type input:
<div class="container">
<div class="row">
<div class="col-3">
<input type="radio" name="rama" value="1"> Manada
</div>
<div class="col-3">
<input type="radio" name="rama" value="2"> Tropa
</div>
<div class="col-3">
<input type="radio" name="rama" value="3"> Comunidad
</div>
<div class="col-3">
<input type="radio" name="rama" value="4"> Clan
</div>
</div>
</div>
I want that when the person selects a radio input its value is stored in a variable of JS and an alert is shown that shows the selected value; and if the radio input is changed, an alert must also appear with the new selected value.
Thanks in advance for the help for this problem.