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 -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -