HTML DOM Input Email maxLength Property Last Updated : 04 Oct, 2024 Comments Improve Suggest changes Like Article Like Report The Input Email maxLength property in HTML DOM is used to set or return the value of maxlength attribute of a Email Input Field. It specifies the maximum number of characters that have been allowed in the email field. The default value of Input Email maxLength property is 524288. Syntax: It returns the Input Email maxLength property. emailObject.maxLengthIt is used to set the Input Email maxLength property. emailObject.maxLength = numberProperty Values: It contains single value number which is used to specify the maximum number of characters that are allowed in the Email maxlength Field. Return Value: It returns a numeric value which represents the maximum number of character that have been allowed in the Email maxlength field. Example 1: In this example, it returns the max length of the Input Email field. html <!DOCTYPE html> <html> <head> <title> HTML DOM Input Email maxlength Property </title> </head> <body> <h2>DOM Input Email maxLength Property</h2> <form id="myGeeks"> E-mail: <input type="email" id="email" maxlength="45"> </form><br> <button onclick="myGeeks()"> Click Here! </button> <p id="GFG" style="font-size:25px;color:green;"></p> <!-- Script to access input element with type email attribute --> <script> function myGeeks() { let em = document.getElementById("email").maxLength; document.getElementById("GFG").innerHTML = em; } </script> </body> </html> Output:return max lengthExample 2: In this example, maxLength property set max length of character in input field. html <!DOCTYPE html> <html> <head> <title> HTML DOM Input Email maxlength Property </title> </head> <body> <h1> GeeksforGeeks</h1> <h2>DOM Input Email maxLength Property</h2> <form id="myGeeks"> E-mail: <input type="email" id="email" maxlength="45"> </form><br> <button onclick="myGeeks()"> Click Here! </button> <p id="GFG" style="font-size:20px;color:green;"></p> <!-- Script to set Input Email maxlength Property --> <script> function myGeeks() { let em = document.getElementById("email").maxLength = "70"; document.getElementById("GFG").innerHTML = "The value of the maxlength attribute" + " was changed to :" + em; } </script> </body> </html> Output:set max lengthSupported Browsers: The browser supported by DOM input Email maxLength property are listed below: Google ChromeFirefoxOperaSafari Comment More infoAdvertise with us Next Article HTML DOM Input Email maxLength Property M manaschhabra2 Follow Improve Article Tags : Misc Web Technologies HTML HTML-DOM Practice Tags : Misc Similar Reads HTML | DOM Input URL maxLength Property The DOM Input URL maxLength Property in HTML DOM is used to set or return the value of maxlength attribute of a URL Input Field. It specifies the maximum number of characters that have been allowed in the URL field. The default value of Input URL maxLength property is 524288. Syntax: It returns the 2 min read HTML | DOM Input Email pattern Property The Input Email pattern property in HTML DOM is used to set or return the pattern attribute of an email field. It is used to specify the regular expression on which the input elements value is checked against. Use the Global title attribute to describe the pattern for helping the user. Syntax: It re 2 min read HTML | DOM Input Text maxLength Property The DOM Input Text maxLength Property in HTML DOM is used to set or return the value of maxlength attribute of a Text Input Field. It specifies the maximum number of characters that have been allowed in the text field. The default value of Input Text maxLength property is 524288. Syntax: It returns 2 min read HTML | DOM Input Search maxLength Property The DOM Input Search maxLength Property in HTML DOM is used to set or return the value of maxlength attribute of a search Input Field. It specifies the maximum number of characters that have been allowed in the search field. The default value of Input search maxLength property is 524288. Syntax: It 2 min read HTML DOM Input URL minLength Property The Input URL minLength Property in HTML DOM is used to set or return the value of the minlength attribute of a URL Input Field. It specifies the minimum number of characters that have been allowed in the URL field. Syntax: It returns the Input url minLength property.urlObject.minLengthIt is used to 2 min read Like