Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Web Development Articles
Page 141 of 801
HTML DOM Address Object
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 MoreHTML <optgroup> disabled Attribute
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 MoreHTML DOM Anchor hash Property
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 MoreHTML DOM paddingLeft Property
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 MoreHTML DOM Input Button name Property
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 MoreHTML DOM Input Button disabled Property
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 MoreHTML DOM Input Checkbox defaultChecked Property
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 MoreHTML DOM Input Checkbox autofocus Property
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 MoreHTML DOM Input Button form Property
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 MoreHTML DOM History length Property
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