Using "min" attribute with input type "tel" - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Number


Using "min" attribute with input type "tel"

Demo Code

ResultView the demo in separate window

      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <input type="number" data-min="1" id="maskBarToMile" onkeyup="validate_phone(this)"> 
   function validate_phone(element)
   {//from w ww  . j  a v a  2 s  .  co  m
      var min = element.getAttribute('data-min');
      if (element.value.length<min)
      {console.log('value is not acceptable');}

Related Tutorials