title: I want to make display block when there are 17 letters into input
body: <p>So I'm playing with my knowledge around javascript and making form, so i made password input into html and gave maxlength 17 and when someone writes 17 letters i want div to comeout but its not working</p>
  
  <pre><code>function myFunction(){
      var letters = document.getElementsByClassName("inp4");
      var l = letters[0].value.length;
      var wdw = document.getElementById("pas");
      if (l &gt;= 17) {
          wdw.style.display = "block";
      }
  }
  
  &lt;input type="password" class="inp4" maxlength="17" placeholder=" Password" &gt;     
  &lt;!-- javascript when maxlength 17 --&gt;
  &lt;div id="pas"&gt;
      &lt;p&gt;maximum amount of letters is 17&lt;/p&gt;
  &lt;/div&gt;
  &lt;input type="password" class="inp5" maxlength="17" placeholder=" Repeat your password"&gt;
  
  #pas {
      width:200px;
      height:40px;
      background-color:#8DC3D8;
      z-index: 1;
      position: absolute;
      border-radius:5%;
      font-size:0.9rem;   
      padding:5px;
      text-align: center;
      font-family: Verdana, Geneva, sans-serif;
      color:white;
      left:-4.5%;
      bottom:51%;
      display:none;
  }
  </code></pre>