I have drop down select and show hide other fields (within divs) based on option selected in the dropdown list.
This code works fine and show hide based on selection but
Just do the same in document.ready
$(document).ready(function(){
$('#row1_col1_layout_type1, #row1_col1_layout_type2, #row1_col1_layout_type3').hide();
$('#row1_col1_' + $('#row1_layout_options').val()).show();
$('#row1_layout_options').on('change',function() {
$('#row1_col1_layout_type1, #row1_col1_layout_type2, #row1_col1_layout_type3').hide();
$('#row1_col1_' + $(this).val()).show();
});
});
here is the fiddle