Found 2202 Articles for HTML

Execute a script when the browser window is being resized in HTML?

Daniol Thomas
Updated on 30-May-2020 23:28:32

285 Views

When the web browser window is resized, the onresize attribute triggers.ExampleYou can try to run the following code to implement onresize attribute −           Resize the window to trigger event.                function display() {             alert("Web browser window resized!");          }          

Execute a script when a reset button in a form is clicked in HTML?

Govinda Sai
Updated on 03-Mar-2020 09:25:31

250 Views

When a form is reset, the onreset attribute triggers. You can try to run the following code to implement onreset attribute −Example                    Student Name:                              Student Subject:                                                    function display() {             alert("Form reset successfull!");          }          

Execute a script when an element's scrollbar is being scrolled in HTML?

usharani
Updated on 03-Mar-2020 09:36:30

197 Views

When an element is scrolled, the onscroll attribute triggers. You can try to run the following code to implement onscroll attribute −Example                    #myid {             width   : 250px;             height  : 80px;             border  : 2px solid blue;             overflow: scroll;          }                     Scroll the box.       This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text.                      function display() {             document.getElementById("myid").style.color = "blue";          }          

Execute a script when the media is paused either by the user or programmatically in HTML?

George John
Updated on 03-Mar-2020 07:44:55

178 Views

The onpause attribute trigger when the media is paused. You can try to run the following code to implement the onpause attribute −Example           Play                                    Your browser does not support the video element.                      function myFunction() {          document.getElementById("test").innerHTML = "Media paused!";          }          

Execute a script when a mouse pointer moves over an element in HTML?

usharani
Updated on 30-May-2020 23:25:36

351 Views

The onmouseover attribute triggers when a mouse pointer moves over an element in HTML.ExampleYou can try to run the following code to implement onmouseover attribute −                    This is demo heading.             Keep the mouse cursor on the heading to change the color.                function display() {             document.getElementById("myid").style.color = "red";          }          

Execute a script when the media has paused but is expected to resume in HTML?

Krantik Chavan
Updated on 03-Mar-2020 07:40:21

129 Views

The onwaiting attribute triggers when a video pause and buffers to reume again. You can try to run the following code to implement the onwaiting attribute −Example           Play                                    Your browser does not support the video element.                      function myFunction() {             document.getElementById("test").innerHTML = "Media resumes again";          }          

How to display human readable date in HTML?

Priya Pallavi
Updated on 24-Jun-2020 09:01:19

588 Views

Use the HTML tag is used for displaying the human-readable date and time. The following is the attribute −AttributeValueDescriptiondatetime datetimeit is machine readable date timeExampleYou can try to run the following code to display time −           HTML time Tag               The time is 18:16 pm    

Execute a script each time the volume of a video/audio is changed in HTML?

Chandu yadav
Updated on 03-Mar-2020 07:39:35

132 Views

The onvolumechange attribute trigger when the user change the volume of the video or audio accessed on the web page. This change can be volume up, volume down, mute, etc.ExampleYou can try to run the following code to implement onvolumechange attribute −           Play                                    Your browser does not support the video element.                      function myFunction() {          document.getElementById("test").innerHTML = "Volume changed";          }          

Execute a script when the mouse wheel rolls up or down over an element in HTML?

varun
Updated on 03-Mar-2020 07:41:06

139 Views

The onwheel attribute triggers when the mouse wheel rolls up or down over an element. You can try to run the following code to implement onwheel attribute −Example                    This is demo heading.             Click above and use mouse wheel to change the heading color.                function mouseWheel() {             document.getElementById("myid").style.color = "red";          }          

Execute a script when a page has unloaded in HTML?

Ramu Prasad
Updated on 03-Mar-2020 07:37:55

154 Views

The unloaded attribute triggers when a web page has unloaded. You can try to run the following code to implement unloaded attribute in HTML −Example           Tutorialspoint       Simply Easy learning                function display() {             alert("Bye!");          }          

Advertisements