Javascript examples for DOM HTML Element:Input Email field
Input Email maxLength Property - Set the maximum number of characters allowed in an email field:
<!DOCTYPE html> <html> <body> E-mail: <input type="email" id="myEmail"> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {/*w w w.ja va 2 s . c om*/ document.getElementById("myEmail").maxLength = "8"; document.getElementById("demo").innerHTML = "Maximum number of characters allowed in the email field is now 8."; } </script> </body> </html>