javascript - Unable to hide or show div based on radio button selection in jQuery -
i'm working on requirement, in display fields based on radio button selection. below code -
$( document ).ready(function() { $('#selection_0').select(function () { $('#text_to_speech').show(); $('#recorded_messages').hide(); $('#recorded_messages').find('input, textarea, button, select').each(function () { $(this).prop('disabled', true)}); $('#text_to_speech').find('input, textarea, button, select').each(function () { $(this).prop('disabled', false)}); }); $('#selection_1').select(function () { $('#recorded_messages').show(); $('#text_to_speech').hide(); $('#recorded_messages').find('input, textarea, button, select').each(function () { $(this).prop('disabled', false)}); $('#text_to_speech').find('input, textarea, button, select').each(function () { $(this).prop('disabled', true)}); }); });
i'm unable make code work. there no error in console well. fiddle
try this:
$("input[name=someradiogroup]:radio").change(function () { //your code });
Comments
Post a Comment