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

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

python - Django-cities exits with "killed" -

python - How to get a widget position inside it's layout in Kivy? -