title: Translate Jquery Function Into Pure Javascript
body: <p>This is my third question on the subject. For reasons I won't go into, I cannot use jquery on the site I am working on. How would you suggest I translate this block of code into pure Javascript:</p>
  
  <pre><code>    &lt;script&gt; 
      $(document).ready(function(){
          $('#rule-type').change(function() {
             var val = $(this).val();
             if (val == 'tid and acc') {
                $('#tid-acc').show();
             }
             else {
                $('#tid-acc').hide(); 
             }
          });
      });
  &lt;/script&gt;
  
  &lt;select id="rule-type"&gt;
      &lt;option value="" selected="selected"&gt;None&lt;/option&gt;
      &lt;option value="tid"&gt;tid&lt;/option&gt;
      &lt;option value="tid and acc"&gt;tid and acc&lt;/option&gt;
      &lt;option value="xid"&gt;xid&lt;/option&gt;
  &lt;/select&gt;
  &lt;input id="tid-acc"&gt;
  </code></pre>
  
  <p>Thanks in advance! Here is a link to jfiddle: <a href="http://jsfiddle.net/Wx8Jf/2/" rel="nofollow">http://jsfiddle.net/Wx8Jf/2/</a></p>