Javascript examples for DOM HTML Element:Input Number
Access value from input tel
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> </head> <body> <input type="number" data-min="1" id="maskBarToMile" onkeyup="validate_phone(this)"> <script> function validate_phone(element) {//from w ww .j a v a2 s.c o m var min = element.getAttribute('data-min'); if (element.value.length<min) {console.log('value is not acceptable');} } </script> </body> </html>