I need help with some code I wrote, can someone tell me what I did wrong, it will not work
It is a show, hide when the radio button is pushed here is the code:
HTML:
<h1>Single or Recurring Choice</h1>
<div id="payment_type">
<strong>Please select a payment type:</strong>
<input class="option" type="radio" name="group1" value="single" checked="checked" /> Single
<input class="option" type="radio" name="group1" value="recurring" /> Recurring
<input class="option" type="radio" name="group1" value=“contact" /> Contact Us
</div>
<div id="single">
<!-- information goes here -->
</div>
<div id="recurring">
<!-- information goes here -->
</div>
<div id=“contact">
<!— information goes here-->
</div>
Here is the Script:
(function($){
$(document).ready(function(){
$("#recurring").hide();
$(".option").click(function(){
var val = $(this).val();
if(val=="single"){
$(“#recurring, #contact").hide("slow", function(){
$("#single").show("slow");
});
} else if(val==“recurring”) {
$(“#single, #contact").hide("slow", function(){
$("#recurring").show("slow");
});
} else {
$(“#single, #recurring").hide("slow", function(){
$(“#contact").show("slow");
});
}
});
});
})(jQuery);