title: Input max length checking
body: <p>I have a problem with <code>"checkNumbers()"</code>. I'm trying to check if my input is not bigger than 10 numbers; <code>"isAllowedSymbol()"</code> is working great, but another don't. What is my problem?</p>
  
  <pre><code> function isAllowedSymbol(input)
          { 
              var value = input.value; 
              var rep = /[a-zA-Z]/;
              var rep2 = /[а-яА-Я]/;
  
          if (rep.test(value))
          { 
          value = value.replace(rep, ''); 
          input.value = value; 
                  if (rep2.test(value))
                  { 
                  value = value.replace(rep2, ''); 
                  input.value = value; 
                  }
          } 
      }
      var element = document.querySelector("input[name=answer]");
  
  
      function checkNumbers(element) {
        if (element != null &amp;&amp; element.value.length &gt; 10) {
          element = element.replace(element, '');
        }
      }
  
  &lt;input type="text" maxlength="10" name="answer" onkeyup="isAllowedSymbol(this);checkNumbers(this);" placeholder="Enter data" &gt; &lt;br&gt;
  </code></pre>