I have the following checkbox:
<input type="checkbox" name="responderam" id="responderam" value="1" onchange="Filtra()" /> Mostrar apenas quem respondeu
And the function it calls will refresh the page by setting a flag
function Filtra() {
var respondeu = "";
var valor = $("#responderam").val();
if($("#responderam").is(':checked')){
respondeu = 1;
}
else {
respondeu = 0;
}
}
But this IF does not work at all. And the function also does not take the value "1" of the checkbox even if I check it. I'm using Jquery 1.8.
What am I doing wrong? I've seen answers in other questions but it does not work.