Found 2416 Articles for HTML

HTML DOM Input Reset object

AmitDiwan
Updated on 19-Aug-2019 08:27:30

131 Views

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

HTML DOM Input Reset name property

AmitDiwan
Updated on 19-Aug-2019 08:24:18

104 Views

The HTML DOM Input Reset 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.SyntaxFollowing is the syntax for −Setting the name property −resetObject.name = nameHere, name is for specifying the reset button name.ExampleLet us look at an example for the Reset name property − Input range name Property UserName: Location: Change the name of the above reset button by clicking the below button CHANGE NAME    function ... Read More

HTML DOM Form method Property

AmitDiwan
Updated on 19-Aug-2019 08:19:42

113 Views

The HTML DOM form method property is associated with the method attribute of a form element. This property is used for specifying how the form data should be sent to the server. The address to send data is specified by the action attribute. This property sets or gets the form method property value.SyntaxFollowing is the syntax for −Setting the method property −formObject.method = get|post;Here, 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 not private. The user can see the data being ... Read More

HTML DOM Form length Property

AmitDiwan
Updated on 19-Aug-2019 08:16:31

291 Views

The HTML DOM Form length property is used for returning the number of elements that are present inside the form. It is a read-only property.SyntaxFollowing is the syntax of the Form length property −ormObject.lengthExampleLet us look at an example of the Form length property −    form{       border:2px solid blue;       margin:2px;       padding:4px;    }    function getLength() {       var len=document.getElementById("FORM1").length ;       document.getElementById("Sample").innerHTML = "Number of elements present inside the form are :"+len; } Form length property example ... Read More

HTML DOM Form enctype Property

AmitDiwan
Updated on 19-Feb-2021 07:19:17

110 Views

The HTML DOM Form enctype property is associated with the enctype attribute of the form element. This property sets or returns the enctype attribute value of the form. The enctype attribute is only used if the method attribute value is “POST”. The enctype property is used for specifying the data in the form to be submitted should be encoded.SyntaxFollowing is the syntax for −Setting the enctype property −formObject.enctype = encodingHere, encoding can be “application/x-www-form-urlencoded”, which means all characters are encoded before it is sent and this is the default encoding.Another one is “multipart/form-data”, which specifies that no character should be ... Read More

HTML DOM Form autocomplete Property

AmitDiwan
Updated on 19-Feb-2021 07:20:57

96 Views

The HTML DOM Form autocomplete property is associated with the autocomplete attribute of the form element. Using the autocomplete property we can set or return autocomplete attribute value of the given form. This property specifies if the input field should autocomplete text being written by the user based on the text that was previously written in the text field.The autocomplete property can be turned off for specific input fields if autocomplete is set on for the form and it is true for vice-versa also.SyntaxFollowing is the syntax for −Set the autocomplete property −formObject.autocomplete = on|offHere, “on” is by default and ... Read More

HTML DOM Form action Property

AmitDiwan
Updated on 19-Aug-2019 08:04:53

226 Views

The HTML DOM Form action property is associated with the action attribute of the form element. The form action property specifies the web page to send the form data after being submitted by the user. This attribute is called after the form has been submitted to specify where to submit the form.SyntaxFollowing is the syntax for −Set the Form action property −formObject.action = URLHere, the URL specifies the address to send the form data to. It can be an absolute URL or a relative URL.ExampleLet us look at an example of the form action property −   ... Read More

HTML DOM Form acceptCharset Property

AmitDiwan
Updated on 19-Aug-2019 07:59:20

60 Views

The HTML DOM Form acceptCharset property is associated with the accept-Charset attribute of the element. This property is used for setting and getting the accept-Charset attribute value of a form. It returns the character encoding in the string type.If accept-Charset value is not specified it will return UNKNOWN which indicate that the character encoding is set to the character encoding of the current HTML document.SyntaxFollowing is the syntax for −Setting the acceptCharset property −formObject.acceptCharset = character-setHere, the character-set is the list separated by semicolon or space indicating one or more of the character encoding value. Some of the most ... Read More

HTML DOM Footer object

AmitDiwan
Updated on 19-Feb-2021 07:23:32

513 Views

The HTML DOM Footer object is associated with the HTML element. The element is a type of semantic tag and introduced in the HTML5. Using the Footer object we can create and get the element using the createElement() and getElementById() method respectively.SyntaxFollowing is the syntax for −Creating a footer object −var p = document.createElement("FOOTER");ExampleLet us look at an example of the Footer object −Live Demo    function createFoot() {       var f = document.createElement("FOOTER");       document.body.appendChild(f);       var p = document.createElement("P");       var txt = document.createTextNode("Copyright ... Read More

HTML DOM focus() method

AmitDiwan
Updated on 19-Feb-2021 07:24:59

150 Views

The HTML DOM focus() method is used for giving focus to an HTML element . Focus cannot be applied to all the HTML element.For eg: You cannot focus a tag. To remove the focus from an element use the blur() method.SyntaxFollowing is the syntax −HTMLElementObject.focus()ExampleLet us look at an example of the focus() method −Live Demo    input[type=text]:focus, p:active {       color: blue;       font-size:35px;       background-color:lightpink;       border:2px solid blue;    }    input[type=text]{       color:black;       font-size:20px;    }   ... Read More

Advertisements