So, i'm making a site for a project. I have 2 radio buttons, if the radio button: 'Yes' is checked a div has to be shown on the same page at the moment when the radio button is checked. When the radio button 'no' is checked nothing has to happen and the div shouldn't be shown. here's the thing is was trying but it just won't work. I don't know what's wrong and can't find a solution on the web.
Here's my code:
<?php $ervaringja = 0; ?>
Hebt u enige ervaring met Fitnessen?
<input type="radio" name="ErvaringJa_Nee"
<?php if (isset($Ervaring) && $Ervaring=="Ja") $ervaringja = 1;?>
value="Ja">Ja
<input type="radio" name="ErvaringJa_Nee"
<?php if (isset($Ervaring) && $Ervaring=="Nee") echo "checked";?>
value="Nee">Nee<br>
<?php
if ($ervaringja == 0){
echo '<script>'. 'ervaringjanee()'. '</script>';
}
?>
And the script:
<script>
function ervaringjanee()
{
document.getElementById("WelkeErvaring").style.display = "hidden";
}
</script>
but the div keeps showing up, can some one help me?