Skip to content
Related Articles
Open in App
Not now

Related Articles

HTML DOM Input Search select() Method

Improve Article
Save Article
  • Last Updated : 30 Aug, 2022
Improve Article
Save Article

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. 

  • Parameters: It does not accept any parameter.
  • Return Value: It does not return any value.

Example: This example uses the Input Search select() method to select the content inside the search field.   


<!DOCTYPE html>
        h1 {
            color: green;
        body {
            text-align: center;
    <h2>Input Search select() Method</h2>
    <input type="Search" id="test"
           placeholder="Type to search.."
    <button onclick="selectContent()">
      Select the Content of Search Field
        function selectContent() {
            // Use the select() method


Supported Browsers:

  • Google Chrome 5 and above
  • Edge 12 and above
  • Firefox 4 and above
  • Safari 5 and above
  • Opera 10.6 and above

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!