
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 2202 Articles for HTML

120 Views
The HTML DOM Input search type property is associated with the input element having its type=”search”. It will always return search for the input search element.SyntaxFollowing is the syntax for search type property −searchObject.typeExampleLet us look at an example for the Input search type property −Live Demo Search type property FRUITS: Get the above element type by clicking the below button Get Type function getType() { var t = document.getElementById("SEARCH1").type; document.getElementById("Sample").innerHTML = "The type for the input field is : "+t; } OutputThis will produce the following output −On clicking the “Get Type” button −

111 Views
The HTML DOM Input Search size property is used for setting or returning the input search field size attribute value. It is used for defining the search field width in terms of characters. The default width is of 20 characters.SyntaxFollowing is the syntax for −Setting the Search size property −searchObject.size = numberHere, number represents the search field width in characters. The default width is 20 characters.ExampleLet us look at an example for the Input search size property −Live Demo Input search size property FRUITS: Change the Search field width by clicking the below button CHANGE ... Read More

121 Views
The HTML DOM input Search required property is associated with the required attribute of an element. The required property is used for setting and returning if it is necessary to fill some search field or not before the form is submitted to the server. This allows the form to not submit if a search field with required attribute is left empty by the user.SyntaxFollowing is the syntax for −Setting the required property −searchObject.required = true|falseHere, true represents that the search field must be filled while false represents its optional to fill the field before submitting the form.ExampleLet us look ... Read More

127 Views
The HTML DOM Input Search readOnly property is used for setting or returning if the input search field is read-only or not. The readOnly property makes the element non-editable but it can still be focused by tab or click. If there is a default value inside a read-only element then it is sent to server on submit.SyntaxFollowing is the syntax for −Setting the readOnly property −searchObject.readOnly = true|falseHere, true represents the search field is read only while false represents otherwise. The readOnly property is set to false by default.ExampleLet us look at an example for the Search readOnly property − ... Read More

265 Views
The HTML DOM Input Search placeholder property is used for setting or returning the placeholder attribute value of an input search field. The placeholder property is used for giving the web page users a hint about the input element by showing a text inside the input field before the user inputs anything. The placeholder text is greyed by default and isn’t submitted to the form unlike the value property.SyntaxFollowing is the syntax for −Setting the placeholder property −searchObject.placeholder = textHere, text represents the placeholder text specifying the hint for the user about the search field.ExampleLet us look at an example ... Read More

143 Views
The HTML DOM Input Search pattern property is used for setting or returning the pattern attribute of an input search field. It checks the search field time against a regular expression that is specified by the pattern property.SyntaxFollowing is the syntax for −Setting the pattern property −searchObject.pattern = regexpHere, regexp is a regular expression against which the search field is checked.ExampleLet us look at an example for the Input Search pattern property −Live Demo Input Search pattern property The time inside search field can either be of three numeric characters or 6 alphabet characters from a to g ... Read More

138 Views
The HTML DOM Input Search object is associated with the element with type “search”. We can create and access an input element with type search using the createElement() and getElementById() method respectively.PropertiesFollowing are the properties for the Input Search object −PropertyDescriptionautocompleteTo set or return if the search field should get focus automatically when the page loads or not.autofocusTo set or return if the search field should get focus automatically when the page loads or not.defaultValueTo set or return the search field default value.disabledTo set or return if the reset button has been disabled, or not.formTo return the reference of ... Read More

128 Views
The HTML DOM Input Search name property is used for setting or returning the name attribute of a reset button. The name attribute helps in identifying the form data after it has been submitted to the server. JavaScript can also use the name attribute to refer form elements for manipulating later on.SyntaxFollowing is the syntax for −Setting the name property −searchObject.name = nameHere, name is for specifying the search field name.ExampleLet us look at an example for the Search name property − Input search name Property FRUITS: Change the name of the above search field ... Read More

173 Views
The HTML DOM Input Search maxlength property is used for setting or returning the maxlength attribute of the input search field. The maxLength property specifies the maximum number of characters you can type in a search field.SyntaxFollowing is the syntax for −Set the maxLength property −passwordObject.maxLength = integerHere, integer specifies the maximum number of characters that can be entered in the search field. The default value for this is 524288.ExampleLet us look at an example for the maxLength property − Input Search maxLength Property FRUITS: Increase the maximum number of characters to be entered for ... Read More

145 Views
The HTML DOM Input Search form property is used for returning the form reference that contains the given input search field. If the search field is outside the form then it will simply return NULL. This property is read-only.SyntaxFollowing is the syntax for input search form property −searchObject.formExampleLet us look at an example for the HTML DOM Input search form property − Input search form Property FRUITS: Get the form id by clicking on the below button GET FORM function formId() { var P=document.getElementById("SEARCH1").form.id; document.getElementById("Sample").innerHTML = ... Read More