Open In App

HTML | DOM Input Search form Property

Last Updated : 25 Aug, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

The DOM Input Search form Property in HTML DOM is used for returning the reference of the form containing the input search field. It is read-only Property that returns a form object on success. 
Syntax: 
 

searchObject.form 

Return Values: It returns a string value which specify the reference of the form containing the Input Search field

Example: Below Program that illustrates the Input search form property. 
 

html




<!DOCTYPE html>
<html>
 
<head>
    <title>
      Input Search form Property
  </title>
    <style>
        h1 {
            color: green;
        }
         
        h2 {
            font-family: Impact;
        }
         
        body {
            text-align: center;
        }
    </style>
</head>
 
<body>
 
    <h1>GeeksforGeeks</h1>
    <h2>Input Search form Property</h2>
    <form id="myGeeks">
        <input type="Search"
               id="test"
               name="myGeeks"
               placeholder="Type to search..">
    </form>
    <br>
    <br>
    <button ondblclick="Access()">
      click here
    </button>
 
    <p id="check"
       style="font-size:24px;
              color:green;">
  </p>
 
 
 
 
    <script>
        function Access() {
 
            // Return Input search form property
            var s = document.getElementById(
                "test").form.id;
           
            document.getElementById(
                "check").innerHTML = s;
        }
    </script>
 
</body>
 
</html>


Output:
Before Clicking On Button: 
 

After Clicking On Button: 
 

Supported Browsers: The browser supported by DOM input search form Property are listed below: 
 

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

 



Similar Reads

HTML | DOM Input Search value Property
The DOM Input Search value Property in HTML DOM is used to set or return the value of a value attribute of the search field. The value attribute specifies the initial value of the input search Field. It contains the default value or user types. Syntax: It returns the value property.searchObject.valueIt is used to Set the value property.searchObject
2 min read
HTML | DOM Input Search size Property
The DOM Input Search size Property in HTML DOM is used to set or return the value of the size attribute of an Input search Field. The size attribute is used to define the width of a search field. Its default value is 20. Syntax: It returns the Input search size property. searchObject.sizeIt is used to set the Input search size property. searchObjec
2 min read
HTML | DOM Input Search placeholder Property
The DOM Input Search placeholder Property in HTML DOM is used to set or return the value of the placeholder attribute of a search field. The placeholder attribute specifies the short hint that describes the expected value of an input field. The short hint is displayed in the field before the user enters a value. Syntax: It returns the placeholder p
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 returns the Input search pattern property.searchObject.
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 returns the Input search maxLength property.search
2 min read
HTML | DOM Input Search type Property
The DOM Input Search type Property in HTML DOM is used to return the type of form element of the search field. It always returns the text for an Input search field. Syntax: searchObject.type Return Values: It returns a string value which represents the type of form element of the search field The below program illustrates the search type property i
1 min read
HTML | DOM Input Search disabled Property
The DOM Input Search disabled Property in HTML DOM is used to return a boolean value that represents that a search field should be disabled or not. Disabled elements are shown in gray by default and are unusable and un-clickable. Syntax: It returns the disabled property.searchObject.disabledIt is used to set the disabled property.searchObject.disab
2 min read
HTML | DOM Input Search defaultValue Property
The DOM Input Search defaultValue Property in HTML DOM is used to set or return the default value of the search Field. This property is used to reflect the HTML value attribute. The main difference between the default value and value is that the default value indicates the default value and the value contains the current value after making some cha
2 min read
HTML | DOM Input Search autofocus Property
The DOM Input Search autofocus Property in HTML DOM is used to set or return whether the Input search Field should get focus or not when the page loads. It reflects the HTML autofocus attribute. Syntax: It returns the autofocus property.searchObject.autofocusIt is used to set the autofocus property.searchObject.autofocus = "true|false" Property Val
2 min read
HTML | DOM Input Search autocomplete Property
The DOM Input Search autocomplete Property in HTML DOM is used to set or return the value of the autocomplete attribute of an Input search field. The autocomplete attribute is used to specify whether the autocomplete attribute has “on” or “off” value. When the autocomplete attribute is set to on, the browser will automatically complete the values b
2 min read
Article Tags :