title: Javascript for showing and hiding a div based on select options
body: <p>I need some JavaScript code to validate the page. Here is the html, </p>
  
  <pre><code>&lt;select id="sel"&gt;
  &lt;option value="0" selected="selected"&gt;Please select&lt;/option&gt;
  &lt;option value="first"&gt;Link 1&lt;/option&gt;
  &lt;option value="second"&gt;Link 2&lt;/option&gt;
  &lt;option value="third"&gt;Link 3&lt;/option&gt;
  &lt;option value="last"&gt;No Link&lt;/option&gt;
  &lt;/select&gt;
  
  &lt;div class="sample" style="display:none;"&gt;Sample Text&lt;/div&gt;
  &lt;input type="button" value="submit" class="inputclass" /&gt;
  </code></pre>
  
  <p>Need some JavaScript code, </p>
  
  <ol>
  <li>when user clicks first or last option, show the div and hide the button</li>
  <li>when user clicks any of the link, hide the div and show the button</li>
  </ol>
  
  <p>P.S : </p>
  
  <p>Options in the Select will generate dynamically from the database.
  My page will only run in JavaScript, hence no need of Jquery. </p>
  
  <p>Please help...</p>