Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
HTML Articles
Page 142 of 151
How to get the value associated with the http-equiv or name attribute in HTML?
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 MoreExecute a script when the user writes something in a search field in HTML?
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 MoreExecute a script when an element's scrollbar is being scrolled in HTML?
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 MoreExecute a script when a reset button in a form is clicked in HTML?
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 MoreExecute a script when the media is paused either by the user or programmatically in HTML?
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 MoreExecute a script each time the volume of a video/audio is changed in HTML?
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 MoreExecute a script when the browser window is closed in HTML?
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 MoreExecute a script when a user navigates away from a page in HTML?
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 MoreExecute a script when the browser starts to work online in HTML?
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 MoreExecute a script when a mouse pointer moves out of an element in HTML?
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