Execute Script on User Input in HTML Search Field

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

215 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;          }          

Execute Script When Element's Scrollbar is Scrolled in HTML

usharani
Updated on 03-Mar-2020 09:36:30

215 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 Script When Reset Button is Clicked in HTML

Govinda Sai
Updated on 03-Mar-2020 09:25:31

269 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!");          }          

Different Compilation Modes of a Module in Java 9

raja
Updated on 03-Mar-2020 08:35:30

319 Views

A module is a container of packages and each module contains a module descriptor that includes module name, module dependencies,  it means that the name of other modules depends on and name of the packages it exports that can be used only by modules that depend on it.module com.tutorialspoint.app {    /** Modules upon which the module com.tutorialspoint.app depends on */    requires com.tutorialspoint.services;    /** Packages exposed by this module which can be used by other modules */    exports com.tutorialspoint.app.util; }There are three different compilation modes provided by Java 9 Module: Legacy mode, single module mode, and multi-module mode.Compilation modes of ... Read More

Execute Script When Media is Paused in HTML

George John
Updated on 03-Mar-2020 07:44:55

193 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 Script on Mouse Wheel Events in HTML

varun
Updated on 03-Mar-2020 07:41:06

164 Views

The onwheel attribute triggers when the mouse wheel rolls up or down over an element. You can try to run the following code to implement onwheel attribute −Example                    This is demo heading.             Click above and use mouse wheel to change the heading color.                function mouseWheel() {             document.getElementById("myid").style.color = "red";          }          

Execute a Script When Media Pauses in HTML

Krantik Chavan
Updated on 03-Mar-2020 07:40:21

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

Execute Script on Volume Change of Video/Audio in HTML

Chandu yadav
Updated on 03-Mar-2020 07:39:35

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

Execute a Script When the Browser Window is Closed in HTML

Prabhas
Updated on 03-Mar-2020 07:38:46

751 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!");          }          

Execute Script When Page Has Unloaded in HTML

Ramu Prasad
Updated on 03-Mar-2020 07:37:55

170 Views

The unloaded attribute triggers when a web page has unloaded. You can try to run the following code to implement unloaded attribute in HTML −Example           Tutorialspoint       Simply Easy learning                function display() {             alert("Bye!");          }          

Advertisements