HTML Articles

Page 142 of 151

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

Abhinanda Shri
Abhinanda Shri
Updated on 03-Mar-2020 187 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.    

Read More

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

Ankith Reddy
Ankith Reddy
Updated on 03-Mar-2020 228 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;          }          

Read More

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

usharani
usharani
Updated on 03-Mar-2020 229 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";          }          

Read More

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

Govinda Sai
Govinda Sai
Updated on 03-Mar-2020 279 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!");          }          

Read More

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

George John
George John
Updated on 03-Mar-2020 205 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!";          }          

Read More

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

Chandu yadav
Chandu yadav
Updated on 03-Mar-2020 162 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";          }          

Read More

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

Prabhas
Prabhas
Updated on 03-Mar-2020 767 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!");          }          

Read More

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

Nishtha Thakur
Nishtha Thakur
Updated on 03-Mar-2020 301 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};

Read More

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

Smita Kapse
Smita Kapse
Updated on 03-Mar-2020 157 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.    

Read More

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

Sravani S
Sravani S
Updated on 03-Mar-2020 167 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";          }          

Read More
Showing 1411–1420 of 1,508 articles
« Prev 1 140 141 142 143 144 151 Next »
Advertisements