Web Development Articles

Page 133 of 801

HTML ondrag Event Attribute

AmitDiwan
AmitDiwan
Updated on 11-Mar-2026 185 Views

The HTML ondrag event attribute is triggered when the user drags an HTML element in an HTML document. The HTML image and link elements are dragged by default so there is no need to specify ondrag attribute on them.SyntaxFollowing is the syntax −ExampleLet us see an example of HTML ondrag event Attribute −    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;     ...

Read More

HTML onpaste Event Attribute

AmitDiwan
AmitDiwan
Updated on 11-Mar-2026 277 Views

The HTML onpaste attribute is triggered when user paste some content in an HTML element in an HTML document.SyntaxFollowing is the syntax −Let us see an example of HTML onpaste event Attribute −Example    body {       color: #000;       height: 100vh;       background: linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%) no-repeat;       text-align: center;       padding: 20px;    }    p {       border: 2px solid #fff;       padding: 8px;       text-align: justify;    }    textarea {       border: ...

Read More

HTML onresize Event Attribute

AmitDiwan
AmitDiwan
Updated on 11-Mar-2026 149 Views

The HTML onresize attribute is triggered when user resize the browser window.SyntaxFollowing is the syntax −Let us see an example of HTML onresize event Attribute −Example    body {       color: #000;       height: 100vh;       background: linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%) no-repeat;       padding: 20px;    } HTML onresize Event Attribute Demo Now resize the browser window    function resizeFn() {       document.body.style.background = 'linear-gradient(45deg, #8BC6EC 0%, #9599E2 100%) no-repeat';    } OutputNow resize the browser window to observe how onresize event attribute works.

Read More

HTML onsubmit Event Attribute

AmitDiwan
AmitDiwan
Updated on 11-Mar-2026 476 Views

The HTML onsubmit event attribute is triggered when the form is submitted in an HTML document.SyntaxFollowing is the syntax −Let us see an example of HTML onsubmit event Attribute −Example    body {       color: #000;       height: 100vh;       background: linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%) no-repeat;       text-align: center;       padding: 20px;    }    textarea {       border: 2px solid #fff;       background: transparent;       font-size: 1rem;    }    ::placeholder {       color: #000;     ...

Read More

HTML onscroll Event Attribute

AmitDiwan
AmitDiwan
Updated on 11-Mar-2026 255 Views

The HTML onscroll event attribute is triggered when an HTML element is scrolled by using its scrollbar in an HTML document.SyntaxFollowing is the syntax −Let us see an example of HTML onscroll event Attribute −Example    body {       color: #000;       height: 100vh;       background: linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%) no-repeat;       text-align: center;       padding: 20px;    }    .box-para {       border: 2px solid #fff;       padding: 10px;       width: 200px;       height: 200px;     ...

Read More

HTML onsearch Event Attribute

AmitDiwan
AmitDiwan
Updated on 11-Mar-2026 151 Views

The HTML onsearch event attribute is triggered when a user hit “Enter” key in an HTML input element with type=”text” in an HTML document.SyntaxFollowing is the syntax −Let us see an example of HTML onsearch event Attribute −Example    body {       color: #000;       height: 100vh;       background: linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%) no-repeat;       text-align: center;       padding: 20px;    }    input {       border: 2px solid #fff;       background: transparent;       height: 2rem;       padding: ...

Read More

HTML onselect Event Attribute

AmitDiwan
AmitDiwan
Updated on 11-Mar-2026 214 Views

The HTML onselect event attribute is triggered when a user selects some text of an HTML element in an HTML document.SyntaxFollowing is the syntax −Let us see an example of HTML onselect event Attribute −Example    body {       color: #000;       height: 100vh;       background: linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%) no-repeat;       text-align: center;       padding: 20px;    }    textarea {       border: 2px solid #fff;       background: transparent;       padding: 10px;    }    ::placeholder {     ...

Read More

HTML ontoggle Event Attribute

AmitDiwan
AmitDiwan
Updated on 11-Mar-2026 227 Views

The HTML ontoggle event attribute is triggered when a user opens or closes the HTML element in an HTML document.SyntaxFollowing is the syntax −ContentLet us see an example of HTML ontoggle event Attribute −Example    body {       color: #000;       height: 100vh;       background: linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%) no-repeat;       text-align: center;       padding: 20px;    } HTML ontoggle Event Attribute Demo Hi! I'm summary element This is a paragraph with some dummy content.    function toggleFn() { ...

Read More

HTML onwheel Event Attribute

AmitDiwan
AmitDiwan
Updated on 11-Mar-2026 154 Views

The HTML onwheel event attribute is triggered when the user moves the wheel of the mouse on an HTML element in an HTML document.SyntaxFollowing is the syntax −ContentLet us see an example of HTML onwheel event Attribute −Example    body {       color: #000;       height: 100vh;       background: linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%) no-repeat;       text-align: center;       padding: 20px;    }    .wheel {       border: 2px solid #fff;       padding: 10px;    } HTML onwheel Event Attribute ...

Read More

HTML onerror Event Attribute

AmitDiwan
AmitDiwan
Updated on 11-Mar-2026 338 Views

The HTML onerror event attribute is triggered when an error occurs while loading an external file in an HTML document.SyntaxFollowing is the syntax −ContentLet us see an example of HTML onerror event Attribute −Example    body {       color: #000;       height: 100vh;       background: linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%) no-repeat;       text-align: center;       padding: 20px;    }    .btn {       background: #db133a;       border: none;       height: 2rem;       border-radius: 2px;       width: 40%; ...

Read More
Showing 1321–1330 of 8,006 articles
« Prev 1 131 132 133 134 135 801 Next »
Advertisements