title: Get Select Value On Document Ready As Well As On Change
body: <p>I am trying to get the value of a dropdown select element (within a form) on page load as well as on change and pass it to another input (hidden). Here are the code I have tried so far.</p>
  
  <p>This one works on page load, but now working when changed:</p>
  
  <pre><code>        jQuery( document ).ready(function() {
          var comment_post_ID = jQuery("#alldentists").val();
              jQuery("#comment_post_ID").val( comment_post_ID );
          });
  </code></pre>
  
  <p>This doesn't work on pageload but working on changing the select options.</p>
  
  <pre><code>        jQuery( document ).ready(function() {
  
              jQuery( "#alldentists" ).change(function() {
                  var comment_post_ID = jQuery("#alldentists").val();
  
              });
              jQuery("#comment_post_ID").val( comment_post_ID );
          });
  </code></pre>
  
  <p>Is there any way I can get the value on both pageload as well as on change? I am using jQuery 1.11.0.</p>