title: jQuery - run a function of change() and ready()
body: <p>I have a jquery code which run on <code>.change()</code>.
  But I want to run the same code on jquery <code>.ready()</code>, but it is not working.</p>
  
  <h2><strong>Here is my code:</strong></h2>
  
  <pre><code>    jQuery('.nhp-opts-select-hide-below').change(function(){
          var option = jQuery('option:selected', this);
          if(option.data('show').length &gt; 0 || option.data('hide').length &gt; 0){
              jQuery(option.data('show')).each(function(){
                  if(jQuery(this).closest('tr').is(':hidden')){
                      jQuery(this).closest('tr').fadeIn('fast');
                  }
              });
              jQuery(option.data('hide')).each(function(){
                  if(jQuery(this).closest('tr').is(':visible')){
                      jQuery(this).closest('tr').fadeOut('fast');
                  }
              });
  
          }else{
              jQuery(option.data('show')).each(function(){
                  if(jQuery(this).closest('tr').is(':visible')){
                      jQuery(this).closest('tr').fadeOut('fast');
                  }
              });
              jQuery(option.data('hide')).each(function(){
                  if(jQuery(this).closest('tr').is(':hidden')){
                      jQuery(this).closest('tr').fadeIn('fast');
                  }
              });     
          }
      }); 
  </code></pre>
  
  <p>please tell me how to run the above code on jquery ready??</p>