title: JQuery (.show .hide)
body: <p>I have a drop-down menu. If a user any option from drop down menu, script displays appropriate div with additional information.</p>
  
  <p>For example, if a user selects <strong>option 2</strong>, the script displays <strong>div "inf2"</strong>.</p>
  
  <p>No problem so far but in same cases the page will load with already selected option in drop down menu. I need some way how to force the script to display appropriate div if any option is already selected on page load.</p>
  
  <pre><code>$(".addinf").hide();
  $("#privacy").change(function() {
      switch ($(this).val()) {
          case "0":
              $(".addinf").hide().parent().find("#inf0").show();
              break;
          case "1":
              $(".addinf").hide().parent().find("#inf1").show();
              break;
          case "2":
              $(".addinf").hide().parent().find("#inf2").show();
              break;
      }
  });
  
  &lt;select id="privacy" name="privacy"&gt;
      &lt;option value="0"&gt;Option 0&lt;/option&gt;
      &lt;option value="1"&gt;Option 1&lt;/option&gt;
      &lt;option value="2"&gt;Option 2&lt;/option&gt;
  &lt;/select&gt;
  
  &lt;div id="inf0" class="addinf"&gt;Info 0&lt;/div&gt;
  &lt;div id="inf1" class="addinf"&gt;Info 1&lt;/div&gt;
  &lt;div id="inf2" class="addinf"&gt;Info2&lt;/div&gt;
  </code></pre>