<div>
@foreach (var j in jornada)
{
<input class="filtro" name="NombrJornada" type="radio" value="@j.IdJornada"/>
@j.Nombre
}
</div>
And my script
$(function () {
$(".filtro").click(function () {
var id = document.getElementsByClassName("filtro")[0].value;
if (id == null)
console.log("Prueba");
else
console.log(id);
});
function ErrorAjax(err) {
alert(err.responseText);
};
});
But when I select a radio button I always get the id 1
They could help me