HTML | DOM Input URL pattern Property Last Updated : 11 Jul, 2025 Summarize Comments Improve Suggest changes Share Like Article Like Report The DOM Input URL pattern Property in HTML DOM is used to set or return the pattern attribute of a URL field. It is used to specify the regular expression on which the input elements value is checked. Use the global title attribute to describe the pattern for helping the user. Syntax: It returns the Input url pattern property.urlObject.patternIt is used to set Input url pattern property.urlObject.pattern = regexp Property Values: It contains single value regexp which is used to specify the regular expression that a URL field value is checked against. Return Value: It returns a string value which represents the regular expression that a URL field value is checked against. Example-1: This example illustrates how to return the Input url pattern property. HTML <!DOCTYPE html> <html> <head> <title> DOM Input URL pattern Property </title> </head> <body> <center> <h1 style="color:green;"> GeeksForGeeks </h1> <h2> DOM Input URL pattern Property </h2> <label for="uname" style="color:green"> <b>Enter URL</b> </label> <input type="url" id="gfg" placeholder="Enter URL" size="20" pattern="https?://.+" title="Include http://"> <br> <br> <button type="button" onclick="geeks()"> Click </button> <p id="GFG" style="color:green; font-size:25px;"> </p> <script> function geeks() { var link = document.getElementById( "gfg").pattern; document.getElementById( "GFG").innerHTML = link; } </script> </center> </body> </html> Output: Before Clicking On Button: After Clicking On Button: Example-2: This Example illustrates how to set the Property. HTML <!DOCTYPE html> <html> <head> <title> DOM Input URL pattern Property </title> </head> <body> <center> <h1 style="color:green;"> GeeksForGeeks </h1> <h2> DOM Input URL pattern Property </h2> <label for="uname" style="color:green"> <b>Enter URL</b> </label> <input type="url" id="gfg" placeholder="Enter URL" size="20" pattern="https?://.+" title="Include http://"> <br> <br> <button type="button" onclick="geeks()"> Click </button> <p id="GFG" style="color:green; font-size:25px;"> </p> <script> function geeks() { var link = document.getElementById( "gfg").pattern = "URL must start with " + "https://www.facebook.com/login/?next=https%3A%2F%2Ffanyv88.com%3A443%2Fhttps%2Fwww.facebook.com%2F%26quot%3B%3B document.getElementById( "GFG").innerHTML = link; } </script> </center> </body> </html> Output: Before Clicking On Button: After Clicking On Button: Supported Browsers: The browser supported by DOM input URL pattern property are listed below: Google Chrome 1+Edge 12+FirefoxOpera 11+Safari Comment More infoAdvertise with us Next Article HTML | DOM Input URL name Property M manaschhabra2 Follow Improve Article Tags : Misc Web Technologies HTML HTML-DOM Practice Tags : Misc Similar Reads HTML | DOM Input Text pattern Property The Input Text pattern Property in HTML DOM is used to set or return the pattern attribute of an text field. It is used to specify the regular expression on which the input elements value is checked. Use the global title attribute to describe the pattern for helping the user. Syntax: It returns the 2 min read HTML | DOM Input Search pattern Property The DOM Input Search pattern Property in HTML DOM is used to set or return the pattern attribute of a search field. It is used to specify the regular expression on which the input elements value is checked. Use the global title attribute to describe the pattern for helping the user. Syntax: It retur 2 min read HTML | DOM Input URL name Property The DOM Input URL name Property in HTML DOM is used to set or return the value of name attribute of a URL field. The name attribute is required for each input field. If the name attribute is not specified in an input field then the data of that field would not be sent at all. Syntax: It returns the 2 min read HTML DOM Input URL list Property The input URL list property in HTML DOM is used to return a reference to the datalist element that contains an input URL field. Syntax: urlObject.list.id Return Value: It returns a string value that represents the value of the id attribute of the datalist element. Example: Below HTML code is used to 1 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 URL placeholder Property The DOM Input URL placeholder Property is used to set or return the value of the Placeholder attribute of a URL Field.The placeholder attribute specifies a short hint as a text in the input field that describes the expected value. Syntax: It is used to return the placeholder property. urlObject.plac 2 min read Like