HTML DOM Option Index Property

AmitDiwan
Updated on 01-Jul-2020 09:53:21

146 Views

The HTML DOM option index property returns and modify the index position of an option in the HTML document.SyntaxFollowing is the syntax −Returning indexobject.indexModifying indexobject.index = “number”ExampleLet us see an example of HTML option index property − Live Demo    html{       height:100%;    }    body{       text-align:center;       color:#fff;       background: linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%) center/cover no-repeat;       height:100%;    }    p{       font-weight:700;       font-size:1.2rem;    }    .drop-down{       width:35%;       border:2px solid #fff; ... Read More

HTML DOM Progress Object

AmitDiwan
Updated on 01-Jul-2020 09:51:24

201 Views

The DOM Progress Object represent the element of an HTML document.Let us create progress object −SyntaxFollowing is the syntax −document.createElement(“PROGRESS”);PropertiesFollowing are the properties of progress object −PropertyExplanationmaxIt returns and alter the value of the max attribute of a progress element in an HTML document.positionIt returns the value of position attribute of a progress element in an HTML document.labelsIt returns a list of progress bar’s labels in an HTML document.valueIt returns and alter the content of the value attribute of a progress element in an HTML document.ExampleLet us see an example of progress object − Live Demo   ... Read More

HTML DOM select Multiple Property

Sharon Christine
Updated on 01-Jul-2020 09:33:54

270 Views

The HTML DOM select multiple property returns and modify whether multiple options can be selected from a drop-down list or not.SyntaxFollowing is the syntax −Returning multipleobject.multipleModifying multipleobject.multiple = true | falseExampleLet us see an example of HTML DOM select multiple property − Live Demo    html{       height:100%;    }    body{       text-align:center;       color:#fff;       background: linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%) center/cover no-repeat;       height:100%;    }    p{       font-weight:700;       font-size:1.2rem;    }    .drop-down{       width:50%;   ... Read More

HTML DOM Select Name Property

Sharon Christine
Updated on 01-Jul-2020 09:26:51

185 Views

The HTML DOM select name property returns and modify the value of the name attribute of the drop-down list in an HTML document.Following is the syntax −Returning nameobject.nameModifying nameobject.name = “text”ExampleLet us see an example of HTML DOM select name property − Live Demo    html{       height:100%;    }    body{       text-align:center;       color:#fff;       background: linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%) center/cover no-repeat;       height:100%;    }    p{       font-weight:700;       font-size:1.2rem;    }    .drop-down{       width:35%;   ... Read More

HTML DOM Select Value Property

Sharon Christine
Updated on 01-Jul-2020 09:24:03

274 Views

The HTML DOM select value property returns and modify the content of the value attribute of a drop-down list.SyntaxFollowing is the syntax −Returning valueobject.valueModifying valueobject.value = true | falseExampleLet us see an example of HTML DOM select value property − Live Demo    html{       height:100%;    }    body{       text-align:center;       color:#fff;       background: linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%) center/cover no-repeat;       height:100%;    }    p{       font-weight:700;       font-size:1.1rem;    }    .drop-down{       width:35%;       ... Read More

HTML DOM Select Size Property

karthikeya Boyini
Updated on 01-Jul-2020 09:22:05

124 Views

The HTML DOM select size property returns and modify the value of the size attribute of a drop-down list.SyntaxFollowing is the syntax −Returning sizeobject.sizeModifying valueobject.size = “number”ExampleLet us see an example of HTML DOM select size property − Live Demo    html{       height:100%;    }    body{       text-align:center;       color:#fff;       background: radial-gradient( circle farthest-corner at 23.1% 64.6%, rgba(129, 125, 254, 1) 0%, rgba(111, 167, 254, 1) 90% ) no-repeat;       height:100%;    }    p{       font-weight:700;       font-size:1.1rem;    } ... Read More

Role of CSS Valid Selector

Chandu yadav
Updated on 01-Jul-2020 09:20:32

194 Views

Use the CSS : valid selector to style all elements with a valid value .ExampleYou can try to run the following code to implement the :valid SelectorLive Demo                    input:valid {             background: red;             color: white;          }                     Heading             The style (red color background) appears if you type a relevant/ valid email address.    

Highlight Active HTML Anchor with CSS

Prabhas
Updated on 01-Jul-2020 09:20:09

3K+ Views

To highlight active HTML anchor with CSS, use the :target selector.ExampleYou can try to run the following code to implement the :target Selector:Live Demo                    :target {             border: 2px solid #D4D4D4;             background-color: orange;             color: white;          }                     Click any of the subject below.       Maths       Java       C++       C       This is demo text.       This is demo text.       This is demo text.       This is demo text.       This is demo text.       Maths Tutorial       Java Tutorial       C++ Tutorial       C Tutorial    

Style Every Element That Is Not the Specified Element with CSS

varma
Updated on 01-Jul-2020 09:19:46

149 Views

To style every element that is not the specified element, use the CSS :not(selector) selector.ExampleYou can try to run the following code to implement the :not selector:Live Demo                    p {             color: red;          }          :not(p) {             color: blue;          }                     Heading 1       Heading 2       Heading 3       This is a paragraph.       This is another paragraph.    

HTML DOM Input Number Required Property

karthikeya Boyini
Updated on 01-Jul-2020 09:19:27

147 Views

The HTML DOM input number required property returns and modify whether the input number field must be filled out before submitting the form.SyntaxFollowing is the syntax −Returning requiredobject.requiredModifying requiredobject.required = true | falseExampleLet us see an example of HTML DOM input number required property − Live Demo    html{       height:100%;    }    body{       text-align:center;       color:#fff;       background: linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%) center/cover no-repeat;       height:100%;    }    p{       font-weight:700;       font-size:1.1rem;    }    input{     ... Read More

Advertisements