title: how to get the maxlength of an input field using javascript
body: <p>I just wanted to know if we could get the maxlength of an input field from javascript</p>
  
  <pre><code>&lt;input type="password" id="password" maxlength="20" &gt;
  </code></pre>
  
  <p>I tried this but it returns undefined</p>
  
  <pre><code>console.log(document.getElementById("password").maxlength);
  </code></pre>