Found 2416 Articles for HTML

How to display human readable date in HTML?

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

470 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

74 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

76 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

88 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!");          }          

Execute a script when the browser window is closed in HTML?

Prabhas
Updated on 03-Mar-2020 07:38:46

515 Views

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

Execute a script when a user navigates away from a page in HTML?

Nishtha Thakur
Updated on 03-Mar-2020 07:37:07

140 Views

When the user navigates from a page, the onpagehide attribute triggers. The navigation occurs when a user clicks a link, closes the browser tab, submits a form, etc.To execute it, try −You can also use,object.onpagehide = function(){script};

Execute a script when the browser starts to work offline in HTML?

seetha
Updated on 03-Mar-2020 07:31:19

166 Views

When the web browser starts to work offline, the onoffline attribute triggers. You can try to run the following code to implement onoffline attribute −Example                    function onlineFunc() {             alert ("Working online!");          }          function offlineFunc() {             alert ("Workinf offline!");          }             Got o the web browser menu bar and click the File menu. Select "Work Offline" and toggle between online and offline.    

Execute a script as long as the mouse pointer is moving over an element in HTML?

Ankith Reddy
Updated on 03-Mar-2020 07:29:12

90 Views

When the mouse pointer is moving over an element, the onmousemove attribute triggers. You can try to the following code to implement onmousemove attribute −Example                    This is demo heading.            Click above and then release.               function mouseMove() {         document.getElementById("myid").style.color = "red";         }          

Execute a script when the browser starts to work online in HTML?

Smita Kapse
Updated on 03-Mar-2020 07:36:24

80 Views

When the web browser starts to work online, the ononline attribute triggers. You can try to run the following code to implement ononline attribute −Example                    function onlineFunc() {             alert ("Working online!");          }          function offlineFunc() {             alert ("Workinf offline!");          }             Got o the web browser menu bar and click the File menu. Select       "Work Offline" and toggle between online and offline.    

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

Sravani S
Updated on 03-Mar-2020 07:29:53

91 Views

When the mouse pointer moves out of an element, the onmouseout attribute triggers. You can try the following code to implement onmouseout attribute −Example                    This is demo heading.             Click above and then release.                function mouseOut() {             document.getElementById("myid").style.color = "red";          }          

Advertisements