Web Development Articles

Page 141 of 801

HTML DOM Address Object

Arjun Thakur
Arjun Thakur
Updated on 11-Mar-2026 232 Views

Use the address object to represent the element. Let us see an example to create −Example Heading Two Create address element Display    function display() {       var a = document.createElement("Address");       var node = document.createTextNode("ABC Inc, P 120, Ontario, Canada");       a.appendChild(node);       document.body.appendChild(a);    } OutputNow, click on the button to display the address −

Read More

HTML <optgroup> disabled Attribute

George John
George John
Updated on 11-Mar-2026 190 Views

The disabled attribute of the is used to disable an option-group. After that, the option-group becomes unclickable. Following is the syntax −Let us now see an example to implement the disabled attribute of the element −Example Water Levels Impurity Level           3:2       5:3               2L       5L       10L       20L     OutputIn the above example, we have set two option-groups −    3:2    5:3    2L    5L    10L    20L We have set one of the option-group as disabled −    2L    5L    10L    20L Now the above options will become disabled and visitors won’t be able to select them.

Read More

HTML DOM Anchor hash Property

Arjun Thakur
Arjun Thakur
Updated on 11-Mar-2026 223 Views

The HTML DOM Anchor hash property is used to set or return the anchor part of the href attribute value. The part of the URL after the # is what we call the anchor part of a link.Following is the syntax to set the hash property −anchorObject.hash = anchor_partAbove, anchor_part is the anchor part of the URL.Following is the syntax to return the hash property −anchorObject.hashLet us now see an example to implement the DOM Anchor hash property −Example Company Our Team Get the anchor part... Display Anchor Part    function display() {       ...

Read More

HTML DOM paddingLeft Property

Sharon Christine
Sharon Christine
Updated on 11-Mar-2026 160 Views

The HTML DOM paddingLeft property returns and add left padding to an HTML element.SyntaxFollowing is the syntax −1. Returning left paddingobject.style.paddingLeft2. Adding left paddingobject.style.paddingLeft=”value”ValuesHere, “value” can be the following −ValueDetailslengthIt defines value padding in length unit.initialIt defines padding to its default value.inheritIn this padding gets inherited from its parent element.percentage(%)It defines padding in percentage of the width of parent element.ExampleLet us see an example of paddingLeft property − HTML DOM paddingLeft property    .outer-box{       background-color:#db133a;       width:300px;       height:300px;       margin:1rem auto;    }    .inner-box{ ...

Read More

HTML DOM Input Button name Property

karthikeya Boyini
karthikeya Boyini
Updated on 11-Mar-2026 175 Views

The HTML DOM name property returns and alter the value of name attribute of an input button in HTML.SyntaxFollowing is the syntax −1. Returning nameobject.name2. Modifying nameobject.name=”text”Here, “text” represents the new name of the input button.ExampleLet us see an example of name property − HTML DOM name Property    body{       text-align:center;    }    .btn{       display:block;       margin:1rem auto;       background-color:#db133a;       color:#fff;       border:1px solid #db133a;       padding:0.5rem;       border-radius:50px;       width:80%;    }    .show-name{ ...

Read More

HTML DOM Input Button disabled Property

Sharon Christine
Sharon Christine
Updated on 11-Mar-2026 216 Views

The HTML DOM input button disabled property returns and alter the value of disabled attribute of an input button in HTML.SyntaxFollowing is the syntax −1. Returning nameobject.disabled2. Modifying nameobject.disabled = true|falseExampleLet us see an example of disabled property − HTML DOM disabled Property    body{       text-align:center;    }    .btn{       display:block;       margin:1rem auto;       background-color:#db133a;       color:#fff;       border:1px solid #db133a;       padding:0.5rem;       border-radius:50px;       width:80%;    }    .show-message{       font-weight:bold;   ...

Read More

HTML DOM Input Checkbox defaultChecked Property

karthikeya Boyini
karthikeya Boyini
Updated on 11-Mar-2026 439 Views

The HTML DOM input checkbox defaultChecked property returns the default value of checked attribute of a checkbox in HTML.SyntaxFollowing is the syntax −object.defaultCheckedExampleLet us see an example of defaultChecked property − HTML DOM checked property    body{       text-align:center;    }    p{       font-size:1.5rem;       color:#ff8741;    }    input{       width:30px;       height:30px;    }    button{       background-color:#db133a;       color:#fff;       padding:8px;       border:none;       width:180px;       margin:0.5rem;       border-radius:50px; ...

Read More

HTML DOM Input Checkbox autofocus Property

karthikeya Boyini
karthikeya Boyini
Updated on 11-Mar-2026 207 Views

The HTML DOM Input Checkbox autofocus property returns and modify the value of autofocus attribute of an input HTML element with type=”checkbox”.SyntaxFollowing is the syntax −1. Returning autofocusobject.autofocus2. Modifying autofocusobject.autofocus = true|falseExampleLet us see an example of autofocus property −

Read More

HTML DOM Input Button form Property

Sharon Christine
Sharon Christine
Updated on 11-Mar-2026 177 Views

The HTML DOM input button form property returns the reference of the form which enclose the input button.SyntaxFollowing is the syntax −object.formExampleLet us see an example of input button form property −

Read More

HTML DOM History length Property

Sharon Christine
Sharon Christine
Updated on 11-Mar-2026 162 Views

The HTML DOM History length property returns of URLs in the History list of current window.SyntaxFollowing is the syntax −history.lengthExampleLet us see an example of HTML DOM History length property −    body{       text-align:center;    }    .btn{       background-color:lightblue;       border:none;       height:2rem;       border-radius:50px;       width:60%;       margin:1rem auto;    }    .show{       font-size:2rem;       font-weight:bold;       color:orange;    } History length Property Example Click me to get History length    function getHistoryLength(){       var historyLength=history.length;       document.querySelector(".show").innerHTML = historyLength;    } OutputThis will produce the following output −Click on the “blue” button to see the history length of current browser window.

Read More
Showing 1401–1410 of 8,006 articles
« Prev 1 139 140 141 142 143 801 Next »
Advertisements