Found 2416 Articles for HTML

HTML DOM childNodes Property

AmitDiwan
Updated on 07-Aug-2019 12:35:47

135 Views

The HTML DOM childNodes property returns a collection of node’s child nodes in the form of a NodeList object. The nodes are sorted and are in the same order as they appear in the HTML document. These nodes can be accessed by index number which starts from 0. It is a read-only property. Remember, white spaces and comments are also considered as nodes.SyntaxFollowing is the syntax for childNodes property −elementNodeReference.childNodes;ExampleLet us see an example for the HTML DOM childNodes property −    div {       border: 1px solid blue;       margin: 7px;   ... Read More

HTML DOM childElementCount Property

AmitDiwan
Updated on 07-Aug-2019 12:31:47

47 Views

The HTML DOM childElementCount property is a read-only property that returns the number of child elements of a given element. The return type of the childElementCount is of unsigned long. It will only return the child element of the node on which it is queried and not all the child nodes of a HTML document.SyntaxFollowing is the syntax for childElementCount property −node.childElementCountExampleLet us see an example for the HTML DOM childElementCount property −    div {       border: 2px solid blue;       margin: 7px;       padding-left:20px;    } ... Read More

HTML DOM characterSet Property

AmitDiwan
Updated on 07-Aug-2019 12:27:04

23 Views

The HTML DOM characterSet Property represents the character set that is associated with the charset attribute of the element. By default the character set for an HTML document is UTF-8.The characterSet property returns the character encoding for the HTML document in a string format. The user can override the default characterSet for a web page using the charset property in HTML or the DOM characterSet property.SyntaxFollowing is the syntax for characterSet property −document.characterSetExampleLet us see an example of the HTML DOM characterSet property − Click the below button to know the encoding of this HTML document CHECK ... Read More

HTML DOM Caption Object

AmitDiwan
Updated on 07-Aug-2019 12:23:10

91 Views

The HTML DOM Caption object is associated with the HTML element. The element is used for setting caption (title) of the table and should be the first child of the table. You can access caption element using the caption object.PropertiesNote: The below property are not supported in the HTML5.Following is the HTML DOM Caption Object property −PropertyDescriptionAlignTo set or return the caption alignment.SyntaxFollowing is the syntax for −Creating a caption object −var x = document.createElement("CAPTION");ExampleLet us see an example for the HTML DOM Caption object −    table, th, td {       border: ... Read More

HTML DOM Canvas Object

AmitDiwan
Updated on 20-Feb-2021 06:09:55

265 Views

The HTML DOM Canvas object is associated with the element introduced in HTML5. The tag is used to draw graphics with the help of JavaScript. The canvas acts as a container for graphics. On canvas, we can draw lines, shapes etc.PropertiesFollowing are the properties for Canvas Object −PropertyDescriptionfillStyleTo set or return the color, gradient or pattern that is used to fill the drawing.strokeStyleTo set or return the color, gradient, or pattern used for strokes.shadowColorTo set or return the color to be used for shadows.shadowBlurTo set or return the blur level of shadows.shadowOffsetXTo set or return the horizontal distance ... Read More

HTML DOM cancelable Event Property

AmitDiwan
Updated on 07-Aug-2019 12:11:07

103 Views

The HTML DOM cancelable event property is associated with the HTML events as JavaScript can react to these events. The cancelable event property returns a Boolean true or false indicating whether the event can be cancelled or not.SyntaxFollowing is the syntax for cancelable event property −event.cancelableExampleLet us see an example of cancelable event property − Hover over the button below to find out if onmouseover is cancellable event or not CLICK IT    function cancelFunction(event) {       var x = event.cancelable;       if(x==true)          document.getElementById("Sample").innerHTML = "The onmouseover event ... Read More

HTML DOM Button value Property

AmitDiwan
Updated on 20-Feb-2021 06:12:07

183 Views

The HTML DOM Button value property is associated with value attribute of the element. It specifies the hidden value of the button. The value property sets or returns the value of the value attribute of a button. Browsers generally submit the value text when clicked on a button while others submit the text between the element.SyntaxFollowing is the syntax for −Setting the value property −buttonObject.value = textHere, the text property value is the initial value that is given to the button.ExampleLet us see an example of the button value property −Live Demo My Button Click on ... Read More

HTML DOM Button type Property

AmitDiwan
Updated on 07-Aug-2019 12:02:28

178 Views

The HTML DOM Button type property is associated with the HTML element. The button element by default has type=”submit” i.e clicking on any button on the form will submit the form. The button type property sets or returns the type of button.SyntaxFollowing is the syntax for −Setting the button type property −buttonObject.type = "submit|button|reset"Here, the submit|button|reset are button type values. Submit is set by default.Submit − Makes the button a submit button.Button − Makes a normal clickable button.Reset − Makes a reset button that resets the form data.ExampleLet us see an example of the HTML DOM button type property − ... Read More

HTML DOM Button object

AmitDiwan
Updated on 07-Aug-2019 11:57:48

613 Views

The HTML DOM Button object is associated with the element.PropertiesFollowing are the properties for the HTML DOM button object −PropertyDescriptionautofocusTo set or return whether a button is automatically focused or not when the page loads.disabledTo set or return whether a given button is disabled or not.formTo return the reference of the form containing the button.formActionTo set or return the formAction attribute value of a button.formEnctypeTo set or return the formEnctype attribute value of a button.formMethodTo set or return the formMethod attribute value of a button.formNoValidateTo set or return whether the form data should be validated or not on submission.formTargetTo ... Read More

HTML DOM Button name Property

AmitDiwan
Updated on 07-Aug-2019 11:52:31

222 Views

The HTML DOM Button name property is associated with name attribute of the element. The name property is used to set or return the value of the name attribute of the button. The name attribute is used in forms to select an element using JavaScript.SyntaxFollowing is the syntax for −Setting the name property −buttonObject.name = nameHere, the name property value is used to denote the name of the button.ExampleLet us see an example of the button name property − BUTTON Click the button below and change the above button name. CHANGE    function change() { ... Read More

Advertisements