title: Set Default Visible Div in Dropdown Menu
body: <p>I found a useful script that makes divs visible and hidden using a dropdown menu. The only problem is that all the divs are initially hidden, and I'd like the first one to be visible by default. Here's the script:</p>
  
  <pre><code>&lt;html&gt;
  
      &lt;head&gt;
          &lt;meta http-equiv="content-type" content="text/html;charset=iso-8859-1"&gt;
          &lt;title&gt;Untitled Page&lt;/title&gt;
          &lt;script type="text/javascript"&gt;&lt;!--
  var lastDiv = "";
  function showDiv(divName) {
      // hide last div
      if (lastDiv) {
          document.getElementById(lastDiv).className = "hiddenDiv";
      }
      //if value of the box is not nothing and an object with that name exists, then change the class
      if (divName &amp;&amp; document.getElementById(divName)) {
          document.getElementById(divName).className = "visibleDiv";
          lastDiv = divName;
      }
  }
  //--&gt;
  &lt;/script&gt;
          &lt;style type="text/css" media="screen"&gt;&lt;!--
  .hiddenDiv {
      display: none;
      position: absolute;
      top: 100px;
      }
  .visibleDiv {
      display: block;
      border: 1px grey solid;
          position: absolute;
      top: 100px;
      }
  
  --&gt;&lt;/style&gt;
      &lt;/head&gt;
  
      &lt;body bgcolor="#ffffff"&gt;
          &lt;form id="FormName" action="blah.php" method="get" name="FormName"&gt;
              &lt;select name="selectName" size="1" onchange="showDiv(this.value);"&gt;
                  &lt;option value=""&gt;Choose One...&lt;/option&gt;
                  &lt;option value="one"&gt;first&lt;/option&gt;
                  &lt;option value="two"&gt;second&lt;/option&gt;
                  &lt;option value="three"&gt;third&lt;/option&gt;
              &lt;/select&gt;
          &lt;/form&gt;
          &lt;p id="one" class="hiddenDiv"&gt;This is paragraph 1.&lt;/p&gt;
          &lt;p id="two" class="hiddenDiv"&gt;This is paragraph 2.&lt;/p&gt;
          &lt;p id="three" class="hiddenDiv"&gt;This is paragraph 3.&lt;/p&gt;        
      &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>Thank you.</p>