
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

168 Views
The HTML DOM Input Text name property is used for setting or returning the name attribute of an input text field. The name attribute helps in identifying the form data after it has been submitter to the server.SyntaxFollowing is the syntax for −Setting the name property −textObject.name = nameHere, name is for specifying the text field name.ExampleLet us look at an example for the text name property −Live Demo Input Text name Property USERNAME: Change the name of the text field by clicking the below button CHANGE NAME function changeName() { ... Read More

199 Views
The HTML DOM Input Text maxLength property is used for setting or returning the maxlength attribute of the input text field. The maxLength property specifies the maximum number of characters you can type in a text field.SyntaxFollowing is the syntax for −Setting the maxLength property −textObject.maxLength = integerHere, integer specifies the maximum number of characters that can be typed in the text field.ExampleLet us look at an example for the maxLength property −Live Demo Input Text maxLength Property USERNAME: Increase the maximum number of characters to be entered for the above field by clicking below button CHANGE ... Read More

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

277 Views
The HTML DOM Input Text disabled property is used for setting or returning if the text field should be disabled or not. It uses boolean values with true representing the element should be disabled and false otherwise. The disabled property is set to false by default. The disabled element is greyed out by default and is unclickable.SyntaxFollowing is the syntax for −Setting the disabled property −textObject.disabled = true|false;Here, true=the text field is disabled and false=the text field is not disabled. It is false by default.ExampleLet us look at an example for the Input Text disabled property −Live Demo ... Read More

503 Views
The HTML DOM Input Text defaultValue property is used for setting or getting the defaultValue of a text field. The defaultValue of an element is the value assigned to the value attribute. The difference between value property and defaultValue property is the latter retains the original default value specified while the value property value changes based on the user input in the input field.SyntaxFollowing is the syntax to set the defaultValue property −textObject.defaultValue = valueHere, “value” is the text field default value.ExampleLet us look at an example for the Text defaultValue property −Live Demo Input Text defaultValue Property ... Read More

176 Views
The HTML DOM input Text autofocus property is associated with the HTML element’s autofocus attribute. This property is used for setting or returning if the input text field should be automatically focused when the page loads or not.SyntaxFollowing is the syntax for −Setting the autofocus property −textObject.autofocus = true|falseHere, true represents the text field should get focus and false represents otherwise. It is set to false by default.ExampleLet us look at an example for the HTML DOM Input text autofocus property − Input text autofocus property USERNAME: CHECK FOCUS function FocusVal() { ... Read More

199 Views
The HTML DOM Input Text autocomplete property is associated with the autocomplete attribute of the element with type=”text”. The autocomplete attribute takes “on” or “off” value. The on value specifies that the web browser must automatically complete user text based on previous input while false states otherwise.SyntaxFollowing is the syntax for −Setting the autocomplete Property −textObject.autocomplete = "on|off"Here, on means the browser will complete the user input automatically based on previous input while false states that it will not complete any of the user input based on previous inputs. It has the value set to on by default.ExampleLet us ... Read More

187 Views
The HTML DOM Input submit value property is associated with the input element having type=”submit” and the value attribute. It is used to return the value of submit button value attribute or to set it. The value property for submit button changes the text displayed on button as by default the text is “Submit”.SyntaxFollowing is the syntax for −Setting the value property −submitObject.value = text;Here, text is used for specifying the text displayed on the submit button.ExampleLet us look at an example for the input submit value property −Live Demo Input submit Value property UserName: ... Read More

114 Views
The HTML DOM Input Submit type property is associated with the input element having its type=”submit”. It will always return submit for the input submit element.SyntaxFollowing is the syntax for submit type property −submitObject.typeExampleLet us look at an example for the submit type property − Input range type Property VOLUME Get the above input element type by clicking the below button GET Type function rangeType() { var P=document.getElementById("RANGE1").type; document.getElementById("Sample").innerHTML = "The type for the input field is: "+P ; } OutputThis will produce the following output −On clicking the “GET Type” button −

150 Views
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