HTML DOM Input Search focus() Method Last Updated : 30 Aug, 2022 Comments Improve Suggest changes Like Article Like Report The Input Search focus() Method in HTML DOM is used to get focus to the Input search Field when an event occurs. Syntax: searchObject.focus();Parameter: This method does not contain any parameter value. Return Value: It does not return any value. Example: The below example illustrates the use of the Input search focus() method in HTML DOM. HTML <!DOCTYPE html> <html> <head> <title> Input Search Focus() Method </title> <style> h1 { color: green; } h2 { font-family: Impact; } body { text-align: center; } </style> </head> <body> <h1>GeeksforGeeks</h1> <h3>Input Search Focus() Method</h3> <form id="myGeeks"> <input type="Search" id="test" name="myGeeks" placeholder="Type to search.." value="GeeksforGeeks" autofocus> </form> <br><br> <button onclick="Focus()"> Get Focus </button> <script> function Focus() { var s = document.getElementById("test").focus(); } </script> </body> </html> Output: Input Search focus() MethodSupported Browser: Google Chrome 5 and aboveOpera 10.6 and aboveMicrosoft Edge 12.0 and aboveSafari 5 and aboveFirefox 4 and above Comment More infoAdvertise with us Next Article HTML DOM Input Search focus() Method M manaschhabra2 Follow Improve Article Tags : HTML HTML-DOM HTML-Methods Similar Reads HTML DOM Input URL focus() Method The Input URL focus() method in HTML DOM is used to get focus to the Input URL field when the event occurs. We can use this method for directing the focus of the user when an event occurs. Syntax: URLObject.focus() Parameters: This method does not contain any parameter values. Return Value: It does 1 min read HTML DOM Input Tel focus() Method The input tel focus() method in HTML DOM is used to get focus to an input tel field when the event occurs. Syntax: telObject.focus() Parameters: This method does not accept any parameter values. Return Value: This method does not return any values. Example: Below HTML code illustrates the use of the 1 min read HTML DOM Input Text focus() Method The Input Text focus() method in HTML DOM is used to get focus to the text field when the event occurs. Syntax: textObject.focus() Parameters: This method does not contain any parameter values. Return Value: It does not return any value. Example: Below program illustrates the use of the input text f 1 min read HTML DOM Input Search blur() Method The Input Search blur() method in HTML DOM is used to extract or remove focus from the search field when the event occurs. Syntax: searchObject.blur()Parameters: This method does not contain any parameter values. Return Value: It does not return any value. Example: Below program illustrates the use 1 min read HTML DOM Input Search select() Method The Input Search select() Method in HTML DOM is used to select the content of the Input search text field. It is the predefined method of the Search object. Syntax: searchObject.select()Parameters: It does not accept any parameter.Return Value: It does not return any value. Example: This example use 1 min read Like