I would like a form with radio buttons with an underneath link of "more information" and, according to the selected button, to show this link more of the corresponding information.
Here is my code. But it doesn't work :-(
$(document).ready(function(){
$("div").hide();
});
$(document).ready(function(){
if($('input:radio[name="tarif"][value="jour"]').prop('checked', true)){
$("button").click(function(){
$(".jour").toggle();
});
} else if($('input:radio[name="tarif"][value="nuit"]').prop('checked', true)){
$("button").click(function(){
$(".nuit").toggle();
});
}
});
<INPUT type= "radio" name="tarif" value="jour"> tarif de jour
<INPUT type= "radio" name="tarif" value="nuit"> tarif de nuit
<a href=# class="info">More information</a>
<div class="jour">
<p>
qedaqteeteataeteteat
</p>
</div>
<div class="nuit">
<p>
ZEFSZEFSGDHZEGSHGREZREGR
</p>
</div>
<button>Toggle between hide() and show()</button>
Please, can you help me?