title: Getting a onChange null error for my HTML form
body: <p>This is my form below</p>
  
  <pre><code>&lt;select name="catg" id="select"&gt;
  
      &lt;option&gt; Select..&lt;/option&gt;
      &lt;option value="stu"&gt;Uni Student&lt;/option&gt;
      &lt;option value="anothersstu"&gt;Student at another institution&lt;/option&gt;
      &lt;option value="staff"&gt;Uni Staff&lt;/option&gt;
      &lt;option value="other"&gt;other&lt;/option&gt;
  
  &lt;/select&gt;&lt;br /&gt;
  
  Student Number / Staff Number: &lt;input type="text" name="ss" id="txt"/&gt; &lt;br /&gt;
  </code></pre>
  
  <p>This is my javascript:-</p>
  
  <pre><code>    document.getElementById('select').onchange{
      if(this.value=="stu"){
      document.getElementById('txt').maxLength=8;
      }else{
      document.getElementById('txt').removeAttribute('maxLength');
      }
       };
  </code></pre>
  
  <p>What its meant to do is, when the user selects Uni student from the select menu, the textbox for student number/ staff number has to be maxlength 8. It works in jsfiddle but not on the normal browser. </p>
  
  <p>My error message on chrome:- Cannot read property 'onchange' of null</p>
  
  <p>Any suggestions as to why its happening?</p>