Latest web development tutorials

HTML DOM Input Email pattern property

Input Email Object Reference Input Email Object

Examples

Gets the value of the email field pattern properties:

var x = document.getElementById ( "myEmail" ) .pattern;

x The output is:

[A-z0-9 ._% + -]. + @ [A-z0-9 .-] + \ [az] {2,3} $

try it"


Definition and Usage

pattern attribute is used to set or return the value of the email field pattern property.

pattern attribute describes a regular expression that is used to verify the value of the email field.

Tip: Use the global the HTML title attribute or the DOM title attributes to help the user describe mode.

Hint: You can find out in our JavaScript tutorial regular expressions .

Tip: Similarly, you can also view our JavaScript regular expression reference manual .


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Internet Explorer 10, Firefox, Opera, and Chrome browser support pattern attribute.

Note: Internet Explorer 9 and earlier versions of IE, Safari browser does not support pattern attribute.

Note: Internet Explorer 9 and earlier versions of IE, Safari browser does not support <input type = "email"> element.


grammar

Returns pattern properties:

emailObject .pattern

Set the pattern properties:

emailObject .pattern = regexp

Property Value

value description
regexp Describes a verification email to field regular expression

technical details

return value: String representing a regular expression


Related Pages

HTML Reference Manual: HTML <the INPUT> pattern property


Input Email Object Reference Input Email Object