Found 2202 Articles for HTML

Execute a script at the start of a drag operation in HTML?

Chandu yadav
Updated on 03-Mar-2020 09:44:59

107 Views

Use the ondragstart attribute in HTML to execute a script at the start of a drag operation in HTML.ExampleYou can try to run the following code to implement the ondragstart attribute −                    drag {          float: left;          width: 100px;          height: 35px;          border: 2px dashed #876587;          margin: 15px;          padding: 10px;          }                       ... Read More

Execute a script when the media has reached the end of HTML?

Giri Raju
Updated on 03-Mar-2020 09:43:24

125 Views

Use the onended attribute in HTML to execute a script when the media has reached the end in HTML . You can add messages like “Thank you for watching”, “Stay tuned!”, etc.ExampleYou can try to run the following code to implement the onended attribute −                              Your browser does not support the video element.                      function display() {             alert ("Thank you for watching! Stay tuned!");          }          

Execute a script when the file is unavailable in HTML?

Arjun Thakur
Updated on 03-Mar-2020 09:51:09

204 Views

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 −                              Your browser does not support the video element.                      function display()          {             alert ("Sorry! Empty playlist!");          }          

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

Yaswanth Varma
Updated on 05-Sep-2022 12:48:03

454 Views

Custom attributes are those that are specifically designed and are not included in the standard HTML5 attributes. They enable us to customise HTML tags by adding our own data. A custom attribute is any attribute whose name begins with data-. We can embed custom attributes on all HTML components using the data-* attributes. Syntax: HTML The syntax for the data-* attribute in HTML is relatively simple. Every element starting with data- is a data-* attribute. id = “sample” data-index = 1 data-row = 23 data-column = 44 ... Read More

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

Rishi Rathor
Updated on 03-Mar-2020 09:41:42

139 Views

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 −                    .drag {             float: left;             width: 100px;             height: 35px;             border: 2px dashed #876587;             margin: 15px;             padding: 10px;          }         ... Read More

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

Sreemaha
Updated on 03-Mar-2020 09:40:41

162 Views

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 −           Demonstration                

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

Abhinanda Shri
Updated on 03-Mar-2020 09:38:01

140 Views

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 −                         This is demo text.    

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

Ankith Reddy
Updated on 03-Mar-2020 09:37:13

199 Views

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 −           Search something and press ENTER.             Note: It won' work in Internet Explorer and Firefox.                      function display() {          var a = document.getElementById("inputID");          document.getElementById("test").innerHTML = "Searched for - " + a.value;          }          

How to include the audio/video controls in HTML?

Nancy Den
Updated on 03-Mar-2020 09:38:51

476 Views

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 −           HTML video Tag               Online Compiler                                This browser doesn't support video tag.          

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

varma
Updated on 22-Nov-2023 04:32:49

1K+ Views

To set the coordinates of the area in an image map, 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 −           HTML coords attribute                                        

Advertisements