Execute a script when the file is unavailable in HTML?

Arjun Thakur
Published on 14-Mar-2018 12:01:56
Use the onemptied attribute in HTML to execute a script when the file is unavailable in HTML or it is empty.ExampleYou can try to run the following code to implement the onemptied attribute −<!DOCTYPE HTML> <html>    <body>       <video width = "300" height = "200" controls onemptied ="display()">     ... Read More

Execute a script when an element is being dragged over a valid drop target in HTML?

Rishi Rathor
Published on 14-Mar-2018 12:00:04
When an element is being dragged and dropped in HTML, the ondragover attribute fires.ExampleYou can try to run the following code to implement the ondragover attribute −<!DOCTYPE HTML> <html>    <head>       <style>          .drag {             float: left;   ... Read More

How to store custom data private to the page or application in HTML?

Ankitha Reddy
Published on 14-Mar-2018 12:04:42
Use the data-* attribute in HTML to store custom data private to the page in HTML. It consists of the attribute, which should not contain any uppercase letter and should gets prefixed after data. You can try to run the following code to implement the data-* attribute − Example ... Read More

How to specify the URL of the resource to be used by the object in HTML?

Sreemaha
Published on 14-Mar-2018 11:57:24
Use the data attribute in HTML to specify the URL of the resource to be used by the object in HTML.ExampleYou can try to run the following code to implement the data attribute −<!DOCTYPE html> <html>    <body>       <h2>Demonstration</h2>       <object width = "250" height = "300" ... Read More

Set the coordinates of the area in an image map in HTML?

varma
Published on 14-Mar-2018 11:53:44
Use the cords attribute in HTML to set the coordinates of the area in an image map in HTML.ExampleYou can try to run the following code to implement the cords attribute −<!DOCTYPE html> <html>    <head>       <title>HTML coords attribute</title>    </head>    <body>       <img src = ... Read More

How to include the audio/video controls in HTML?

Nancy Den
Published on 14-Mar-2018 11:54:34
Use the controls attribute in HTML to include audio/ video controls in HTML.ExampleYou can try to run the following code to implement the controls attribute −<!DOCTYPE html> <html>    <head>       <title>HTML video Tag</title>    </head>    <body>       <p>Online Compiler</p>       <br /> ... Read More

How to get the value associated with the http-equiv or name attribute in HTML?

Abhinanda Shri
Published on 14-Mar-2018 11:54:00
Use the content attribute in HTML to get the value associated with http-equiv or name attribute.ExampleYou can try to run the following code to implement the content attribute −<!DOCTYPE html> <html>    <head>       <meta name = "description" content = "Learning content and videos">    </head>    <body> ... Read More

Execute a script when the user writes something in a search field in HTML?

Ankith Reddy
Published on 14-Mar-2018 11:54:50
Use the onsearch attribute in HTML to execute a script when the user writes in a search field and press ENTER or x.ExampleYou can try to run the following code to implement the onsearch attribute −<!DOCTYPE html> <html>    <body>       <p>Search something and press ENTER.</p>     ... Read More

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

usharani
Published on 14-Mar-2018 11:45:41
When an element is scrolled, the onscroll attribute triggers. You can try to run the following code to implement onscroll attribute −Example<!DOCTYPE html> <html>    <head>       <style>          #myid {             width   : 250px;             ... Read More

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

Daniol Thomas
Published on 14-Mar-2018 11:46:16
When the web browser window is resized, the onresize attribute triggers.ExampleYou can try to run the following code to implement onresize attribute −<!DOCTYPE html> <html>    <body onresize = "display()">       <p>Resize the window to trigger event.</p>       <script>          function display() { ... Read More
Advertisements