Found 2416 Articles for HTML

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

96 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

131 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

380 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

949 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                                        

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

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

199 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

167 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

120 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

138 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

261 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

80 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";          }          

Advertisements