Javascript examples for DOM HTML Element:Input Email field
The multiple property sets or gets whether an email field should accept multiple emails.
This property reflects the HTML multiple attribute.
Set the multiple property with the following Values
Value | Description |
---|---|
true|false | Sets whether an email field should accept multiple emails |
A Boolean, returns true if the email field accept multiple emails, otherwise it returns false
The following code shows how to check if an email field accept multiple values/emails:
<!DOCTYPE html> <html> <body> <form action="#"> E-mail: <input type="email" id="myEmail" name="usremail"> <input type="submit"> </form>//from www . ja v a 2 s.c o m <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() { var v = document.getElementById("myEmail").multiple; document.getElementById("demo").innerHTML = v; } </script> </body> </html>