I have this html
<input type="radio" id="radio1" name="radios" value="all" checked>
<label for="radio1">Credit Card</label>
<input type="radio" id="radio2" name="radios"value="false">
<label for="radio2">Debit Card</label>
<input type="radio" id="radio3" name="radios"value="false">
<label for="radio3">Internet Banking</label>
<form id="frm1">
<input type="text" placeholder="1"/>
</form>
<form id="frm2">
<input type="text" placeholder="2"/>
</form>
which has 3 radio buttons and two forms.A css class
.hide
{
display:none;
}
which can hide the form.
I know how to manually hide a form by just adding the class to form element.But I want to create a javascript which will hide any form on radio button selection.
I know this is a little bit of javascript,but Im new to javascript and css.Could someone get me a sytax on how to achieve this?I have made a fiddle as well
Please find it here