title: onblur function not working in javascript
body: <p>I get this error: </p>
  
  <blockquote>
    <p>Uncaught TypeError: required is not a function
        at HTMLInputElement.onblur (index.html:20)</p>
  </blockquote>
  
  <p>Whenever I try to run this  HTML code: </p>
  
  <pre><code>&lt;input type="text" name="nbreAdultes" id="nbreAdultes" autofocus onblur= "return required(document.getElementById('nbreAdultes'));" /&gt;
  </code></pre>
  
  <p>My script:</p>
  
  <pre><code>function required(inputtx) {
      if (inputtx.value == "") { 
          myError.innerHTML = "Input is required";    
          return false; 
      }   
      return true; 
  }
  </code></pre>