Found 2416 Articles for HTML

HTML onsubmit Event Attribute

AmitDiwan
Updated on 26-Sep-2019 08:47:37

312 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 Live Demo    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 onreset Event Attribute

AmitDiwan
Updated on 22-Jun-2020 08:37:55

72 Views

The HTML onreset event attribute is triggered when the form is reset in an HTML document.SyntaxFollowing is the syntax −ExampleLet us see an example of HTML onreset event Attribute − Live Demo    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 onresize Event Attribute

AmitDiwan
Updated on 26-Sep-2019 07:26:46

76 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 Live Demo    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.

HTML onpaste Event Attribute

AmitDiwan
Updated on 26-Sep-2019 07:22:51

161 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 Live Demo    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 {       ... Read More

How to update a MySQL column by subtracting a value with some conditions?

AmitDiwan
Updated on 24-Sep-2019 12:49:00

770 Views

Let us first create a table −mysql> create table DemoTable (    Score int ); Query OK, 0 rows affected (0.65 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(45); Query OK, 1 row affected (0.11 sec) mysql> insert into DemoTable values(29); Query OK, 1 row affected (0.11 sec) mysql> insert into DemoTable values(56); Query OK, 1 row affected (0.09 sec) mysql> insert into DemoTable values(24); Query OK, 1 row affected (0.09 sec) mysql> insert into DemoTable values(32); Query OK, 1 row affected (0.09 sec)Display all records from the table using select statement −mysql> select ... Read More

HTML oninvalid Event Attribute

AmitDiwan
Updated on 24-Sep-2019 12:28:09

234 Views

The HTML oninvalid event attribute is triggered when an input field is invalid while submitting the form in an HTML document.SyntaxFollowing is the syntax −ExampleLet us see an example of HTML oninvalid event Attribute −    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 {     ... Read More

HTML oninput Event Attribute

AmitDiwan
Updated on 24-Sep-2019 12:25:46

235 Views

The HTML oninput event attribute is triggered when the user enters input in an input/textarea HTML element in an HTML document.SyntaxFollowing is the syntax −ExampleLet us see an example of HTML on input event Attribute −    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;       font-size: 1rem;    } HTML oninput Event Attribute Demo    function inputFn() {       document.querySelector('textarea').style.background = '#ffffff36';    } OutputNow enter your message in the text area to observe how oninput event attribute works.

HTML onfocus Event Attribute

AmitDiwan
Updated on 16-Feb-2021 04:30:10

134 Views

The HTML onfocus event attribute is used when an HTML element gets focus in an HTML document.SyntaxFollowing is the syntax −ExampleLet us see an example of HTML onfocus event Attribute −Live Demo    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;       font-size: 1rem;    } HTML onfocus Event Attribute Demo    function focusFn() {       document.querySelector('textarea').style.background = '#ffffff36';    } OutputNow enter your message in the text area to observe how onfocus event attribute works.

HTML ondrag Event Attribute

AmitDiwan
Updated on 16-Feb-2021 04:31:36

98 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 −Live Demo    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 oncontextmenu Event Attribute

AmitDiwan
Updated on 16-Feb-2021 04:33:12

101 Views

The HTML oncontextmenu event attribute is triggered when the user right clicks on an HTML element to open the context menu in an HTML document.SyntaxFollowing is the syntax −ExampleLet us see an example of HTML oncontextmenu event Attribute −Live Demo    body {       color: #000;       height: 100vh;       background-color: #FBAB7E;       background-image: linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%);       text-align: center;       padding: 20px;    }    .box {       background: #db133a;       width: 140px;       height: 140px; ... Read More

Advertisements