DOM Articles

Page 2 of 4

HTML DOM Textarea form Property

AmitDiwan
AmitDiwan
Updated on 11-Mar-2026 245 Views

The HTML DOM Textarea form property returns the cite of the form which enclose the text area.SyntaxFollowing is the syntax −object.formLet us see an example of HTML DOM Textarea form Property:Example    body {       text-align: center;       background-color: #363946;       color: #fff;    }    form {       margin: 2.5rem auto;    }    button {       background-color: #db133a;       border: none;       cursor: pointer;       padding: 8px 16px;       color: #fff;       border-radius: 5px;     ...

Read More

HTML DOM Textarea required Property

AmitDiwan
AmitDiwan
Updated on 11-Mar-2026 172 Views

The HTML DOM Textarea required property returns and modify the value of the required attribute of a text area in an HTML document.SyntaxFollowing is the syntax −1. Returning requiredobject.required2. Modifying requiredobject.required = true | falseLet us see an example of HTML DOM Textarea required Property:Example DOM Textarea required Property    body {       text-align: center;    }    .btn {       display: block;       margin: 1rem auto;       background-color: #db133a;       color: #fff;       border: 1px solid #db133a;       padding: 0.5rem;     ...

Read More

HTML DOM Textarea maxLength Property

AmitDiwan
AmitDiwan
Updated on 11-Mar-2026 239 Views

The HTML DOM Textarea maxLength property returns and modify the value of maxLength attribute of a text area element in an HTML document.SyntaxFollowing is the syntax −1. Returning maxLengthobject.maxLength2. Modifying maxLengthobject.maxLength = “number”Let us see an example of HTML DOM Textarea maxLength Property:Example    body {       color: #000;       height: 100vh;    }    .btn {       background: #db133a;       border: none;       height: 2rem;       border-radius: 2px;       width: 40%;       display: block;       color: #fff;     ...

Read More

HTML DOM Textarea select() Method

AmitDiwan
AmitDiwan
Updated on 11-Mar-2026 197 Views

The HTML DOM Textarea select() Method selects the content of a text area in an HTML document.SyntaxFollowing is the syntax −object.select()Let us see an example of HTML DOM Textarea select() Method −Example    body {       color: #000;       height: 100vh;    }    .btn {       background: #db133a;       border: none;       height: 2rem;       border-radius: 2px;       width: 40%;       display: block;       color: #fff;       outline: none;       cursor: pointer;    } DOM Textarea select() Method Demo Hi! I'm a text area element with some dummy text. Select textarea content    function set() {       document.querySelector("textarea").select();    } OutputClick on “Select textarea content” button to select the content of the textarea element.

Read More

HTML Location assign( ) Method

AmitDiwan
AmitDiwan
Updated on 11-Mar-2026 226 Views

The HTML Location assign() method loads a new HTML document without replacing the URL of the current HTML document from the document history.SyntaxFollowing is the syntax −location.assign(URL)Let us see an example of HTML Location assign() Method−Example    body {       color: #000;       height: 100vh;       background: linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%) no-repeat;       text-align: center;    }    .btn {       background: #db133a;       border: none;       height: 2rem;       border-radius: 20px;       width: 330px;       display: ...

Read More

HTML ononline Event Attribute

AmitDiwan
AmitDiwan
Updated on 11-Mar-2026 175 Views

The HTML ononline event attribute is triggered when the browser starts to work online.SyntaxFollowing is the syntax −Let us see an example of HTML ononline event Attribute−Example    body {       color: #000;       height: 100vh;       background: linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%) no-repeat;       text-align: center;    }    .show {       font-size: 1.2rem;       color: #fff;    } HTML onoffline/ononline Event Attribute Demo Try to disable/enable your network.    function onlineFn() {       alert("Hey! You are online");    }    function offlineFn() {       alert("Hey! You are offline");    } OutputNow try to enable/disable your network to observe how onoffline/ononline event attribute works−

Read More

HTML onpageshow Event Attribute

AmitDiwan
AmitDiwan
Updated on 11-Mar-2026 151 Views

The HTML onpageshow event attribute is triggered when a user navigates to a webpage.SyntaxFollowing is the syntax −Let us see an example of HTML onpageshow event Attribute−Example    body {       color: #000;       height: 100vh;       background: linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%) no-repeat;       text-align: center;    } HTML onpageshow Event Attribute Demo    function showFn() {       alert("Hey! you are on homepage");    } OutputClick on “ok” button of alert box to show the content of the HTML document.

Read More

HTML ondrop Event Attribute

AmitDiwan
AmitDiwan
Updated on 11-Mar-2026 180 Views

The HTML ondrop event attribute is triggered when a draggable element or text is dropped on a valid drop target in an HTML document.SyntaxFollowing is the syntax −Let us see an example of HTML ondrop event Attribute−Example    body {       color: #000;       height: 100vh;       background-color: #FBAB7E;       background-image: linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%);       text-align: center;    }    .drop-target {       display: inline-block;       width: 150px;       height: 150px;       border: 2px solid #FFF;   ...

Read More

HTML onmouseup Event Attribute

AmitDiwan
AmitDiwan
Updated on 11-Mar-2026 164 Views

The HTML onmouseup event attribute is triggered when a mouse button is released from an HTML element in an HTML document.SyntaxFollowing is the syntax −Let us see an example of HTML onmouseup event Attribute−Example    body {       color: #000;       height: 100vh;       background-color: #FBAB7E;       background-image: linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%);       text-align: center;    }    .circle {       background: #db133a;       height: 150px;       width: 150px;       border-radius: 50%;       margin: 10px auto; ...

Read More

HTML onmousedown Event Attribute

AmitDiwan
AmitDiwan
Updated on 11-Mar-2026 208 Views

The HTML onmousedown event attribute is triggered when a mouse button is pressed down on an HTML element in an HTML document.SyntaxFollowing is the syntax −Let us see an example of HTML onmousedown event Attribute−Example    body {       color: #000;       height: 100vh;       background-color: #FBAB7E;       background-image: linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%);       text-align: center;    }    .circle {       background: #db133a;       height: 150px;       width: 150px;       border-radius: 50%;       margin: 10px ...

Read More
Showing 11–20 of 36 articles
Advertisements