HTML DOM Input Search name Property Last Updated : 02 Jan, 2024 Comments Improve Suggest changes Like Article Like Report The Input Search name Property in HTML DOM is used to set or return the value of the name attribute of a search 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 Input search name property.searchObject.nameIt is used to set the Input search name property.searchObject.name = nameProperty Values: It contains a single value name which defines the name of the search field. Return Value: It returns a string value which represents the name of the search field. Example 1: This example returns the Input search name property. html <!DOCTYPE html> <html> <head> <title> HTML DOM Input Search name Property </title> </head> <body style="text-align: center;"> <h1>GeeksforGeeks</h1> <h2>HTML DOM Input Search name Property</h2> <form id="myGeeks"> <input type="Search" id="test" name="myGeeks" placeholder="Type to search..."> </form> <br> <button onclick="myGeeks()"> click here </button> <p id="result"> </p> <script> function myGeeks() { // return input search name property let inputName = document.getElementById("test").name; document.getElementById("result") .innerHTML = inputName; } </script> </body> </html> Output: Example 2: This example illustrates how to set the Input Search name Property. html <!DOCTYPE html> <html> <head> <title> HTML DOM Input Search name Property </title> </head> <body style="text-align: center;"> <h1>GeeksforGeeks</h1> <h2>HTML DOM Input Search name Property</h2> <form id="myGeeks"> <input type="Search" id="test" name="myGeeks" placeholder="Type to search..."> </form> <br> <button onclick="myGeeks()"> Click Here </button> <p id="result"></p> <script> function myGeeks() { // setting input search name property let searchName = document.getElementById("test") .name = "HelloGeeks"; document.getElementById("result").innerHTML = "The value of name attribute changed to " + searchName; } </script> </body> </html> Output: Supported Browsers: Google Chrome 5 and aboveEdge 12 and aboveFirefox 4 and aboveOpera 10.6 and aboveSafari 5 and above Comment More infoAdvertise with us Next Article HTML DOM Input Search name Property M manaschhabra2 Follow Improve Article Tags : Misc Web Technologies HTML HTML-DOM Practice Tags : Misc Similar Reads 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 tel name Property The input tel name property in HTML DOM is used to set or return the value of the name attribute of an input tel 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 retur 1 min read HTML DOM Input Search list Property The input Search list property in HTML DOM is used to return a reference to the list element that contains an input search field. Syntax searchObject.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 used t 1 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 Like