Jquery radio button show and hide divs
- by vzhen
My html and jquery code here. The jquery code performs if value ending with 123 a specify div will show. But i got a problem here. After i clicked on value c123 and d123 and switch back to a and b radio buttons. The showed div will not disappear. How to fix this?
<input type="radio" value="a" />
<input type="radio" value="b" />
<input type="radio" value="c123" />
<input type="radio" value="d123" />
$(".localBank").hide();
$("input[value$='123']").click(function() {
var bank = $(this).val();
$(".localBank").hide();
$("#localBank"+bank).show();
});