title: Javascript: Disable textfield don't work
body: <p>I have tried coding some javascript for form that, when user typing certain word then the textfield below will automatically disable.The problem is, when i the tried the code in jsfiddle the code will run smoothly but when i use it in my project, it don't work.
  Can anybody explain what wrong with my code.</p>
  
  <pre><code>&lt;script&gt;
  function matchWord(e){
  if(document.getElementById('uname').value.trim === 'Unknown' || document.getElementById('uname').value.trim === 'unknown'){
      document.getElementById('pword').disabled = true;
      document.getElementById('response').disabled = true;
      alert('you enter bannned name in the field');
   }
  else{
   }
  }
  document.getElementById('uname').onkeyup = matchWord();
  &lt;/script&gt;
  
  &lt;html&gt;
     &lt;body&gt;
         Name:&lt;input type="text" name="uname" id="uname" placeholder="Username"&gt;&lt;br&gt;
         password:&lt;input type="password" name='pword' id='pword' placeholder="password"&gt;&lt;br&gt;
         Responsibility:&lt;select id = "response"&gt;
                       &lt;option&gt;---Responsibility---&lt;/option&gt;
                        &lt;/select&gt;
     &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>