Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Have 3+ radio buttons that correspond to additional infomation/form elements. The value of each radio button corresponds to a div in the #grounds_more div. This hides all visible divs, then shows the desired one. Toggle doesn't cut it for 3+ items.
$("input[name='grounds']:radio").change( function () {
var val, obj;
val = $(this).val();
obj = $('#' + val);
$("#grounds_more > div:visible").fadeOut(300, function () {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.