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
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
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 −
The HTML DOM Input search value property is associated with the input element having type=”search” and the value attribute. It is used to return the value of input search field value attribute or to set it. This property is used for specifying a default value for search field and it also changes the value to user input.SyntaxFollowing is the syntax for −Setting the value property −searchObject.value = text;Here, text is used for specifying the value for the search field.ExampleLet us look at an example for the input search value property −Live Demo Input search Value property FRUITS: ... Read More
The HTML DOM Input Submit autofocus property is associated with the HTML element’s autofocus attribute. This property is used for setting or returning if the submit button should be automatically focused when the page loads or not.SyntaxFollowing is the syntax for −Setting the autofocus property −submitObject.autofocus = true|falseHere, true represents that the submit button should get focus and false represents otherwise. It is set to false by default.ExampleLet us look at an example for the Input Submit autofocus property −Live Demo Submit Autofocus property UserName: Location: Get the submit button autofocus ... Read More
The HTML DOM Submit formEnctype property is used for setting or returning the formEnctype attribute value of a submit button. It introduced in HTML5 for input element with type submit. It is used for specifying how the data of the form should be encoded when submitted to the server.This property only works if there is method=”post” property. The formEnctype attribute value overrides the enctype attribute value associated with the elementSyntaxFollowing is the syntax for −Setting the submit formEnctype property −submitObject.enctype = encodingHere, encoding can be “application/x-www-form-urlencoded” which means all characters are encoded before sent and this is the default ... Read More
The HTML DOM Input Submit formMethod property is used for setting or returning the formMethod attribute value of a submit button. This specifies which HTTP method to be used when sending form data to the server. The formMethod attribute value overrides the method attribute value associated with the element. It introduced in HTML5 for input element with type submit.SyntaxFollowing is the syntax for −Setting the formMethod property −submitObject.formMethod = get|postHere, get is the default method and appends the form-data to the url. Eg: URL?name=value & name=value. It is usually not secure and can be used for data that is ... Read More
The HTML DOM Input Submit formTarget property is used for setting or returning the formTarget attribute value of a submit button. The HTML DOM Input Submit formTarget property is where the response from server should be displayed after the form data being submitted. The formTarget property overrides the target property of the form element. It introduced in HTML5 for input element with type submit.SyntaxFollowing is the syntax for −Setting the formTarget property −submitObject.formTarget = "_blank|_self|_parent|_top|framename"Here, _blank will open the response in new window;_self will open the response in the same window; parent will open in the parent frame ; _top ... Read More
The HTML DOM Input Submit name property is used for setting or returning the name attribute of a submit button. The name attribute helps in identifying the form data after it has been submitted to the server.SyntaxFollowing is the syntax for −Setting the name property −submitObject.name = nameHere, name is for specifying the submit button name.ExampleLet us look at an example for the Submit name property −Live Demo Input submit name Property UserName: Location: Change the name of the above submit button by clicking the below button CHANGE NAME ... Read More
The HTML DOM Input Submit object is associated with the element with type “submit”. We can create and access an input element with type submit by using the createElement() method and getElementById() method respectively.PropertiesFollowing are the properties for the Input submit object −PropertyDescriptionautofocusTo set or return if the submit button should get focus automatically when the page loads or not.defaultValueTo set or return the submit button default value.disabledTo set or return if the submit button has been disabled, or not.formTo return the reference of the form containing the submit button.formActionTo set to return the formaction attribute value of a ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP