i try to make an jQuery function for hide/show a form based on the user's choice!
Here is my code that you will understand better.
…
<p id="joinChoice" class="parent">
<a href="" id="mastercardChoice"><span class="overlay"></span></a>
<a href="" id="visaChoice"><span class="overlay"></span></a>
<a href="" id="discoverChoice"><span class="overlay"></span></a>
</p>
…
<div class="joinForm">
<div id="noneForm"></div>
<div id="mastercardForm"></div>
<div id="visaForm"></div>
<div id="discoverForm"></div>
</div>
The span#overlay in is a simple checkbox image replacement !
I just need a function for hide/view each form for selected Card type !
For the #joinChoice i've already make this :
$('#joinChoice a').click(function(){
$(this).addClass('on')
.siblings().removeClass('on');
});
Could you help me more please
Update
I was missing an important line:
That prevents the page to reload when clicking on the
<a>
s.The HTML:
The Javascript:
Something like this?
HTML
CSS
jQuery
And a demo