Programming Scripts Articles - Page 26 of 33

What is the role of altKey Mouse Event in JavaScript?

Sravani S
Updated on 23-May-2020 09:13:53

259 Views

The altkey mouse event property is used to show whether SHIFT key is pressed or not when mouse button is clicked.ExampleYou can try to run the following code to learn how to implement altKey Mouse event in JavaScript.           Press and hold ALT key and then click here.                function funcAltKey(event) {             if (event.altKey) {                alert("ALT key: Pressed");             } else {                alert("ALT key: NOT Pressed");             }          }          

Which event occurs in JavaScript when an element is content is copied to clipboard?

Nitya Raut
Updated on 23-May-2020 09:12:11

159 Views

When a user copies the element’s content, then the oncopy event triggers.ExampleYou can try to run the following code to learn how to implement oncopy event in JavaScript.                          function copyFunction() {             document.write("Text copied!");          }          

Which event occurs in JavaScript when an element's content is cut?

V Jyothi
Updated on 23-Jun-2020 09:11:38

171 Views

The oncut event occurs when an element’s content is cut. You can try to run the following code to learn how to work with an oncut event in JavaScript −Example                          function cutFunction() {             document.write("Text cut!");          }          

What is the usage of onsearch event in JavaScript?

Abhinanda Shri
Updated on 22-May-2020 11:28:01

400 Views

The onsearch event is useful for search i.e. a user press ENTER or “x” key in input element. The type for is search, since it is for users to search. The onsearch event isn’t supported in Internet Explorer, Firefox, and Opera.ExampleYou can try to run the following code to learn how to implement onsearch event in JavaScript.           Write what you want to search below and press "ENTER".                      function searchFunc() {             var a = document.getElementById("newInput");             document.write("Searched = " + a.value);          }          

What is the usage of onreset event in JavaScript?

Anjana
Updated on 23-Jun-2020 09:08:43

424 Views

The onreset event is useful when a form is reset. You can try to run the following code to learn how to implement onreset event in JavaScript −Example                    function resetFunct() {             alert("The form was reset");          }                      Enter age:          Enter birth month:                    

What is the usage of oninvalid event in JavaScript?

Smita Kapse
Updated on 22-May-2020 11:17:18

316 Views

The oninvalid event is triggered if the field value added in is invalid. Add a message if the user forgets to fill the form before submission.ExampleYou can try to run the following code to learn how to implement oninvalid event in JavaScript.                    function resetFunct() {             alert("The form was reset");          }                              Enter Name:            Enter birth month:                              

What is the usage of oninput event in JavaScript?

Sai Nath
Updated on 23-Jun-2020 09:06:13

406 Views

When a value is added in an input box, then the oninput event occurs. You can try to run the following code to learn how to implement oninput event in JavaScript −Example           Write below:                            function inputFunc() {             var a = document.getElementById("newInput").value;             document.write("Typed: " + a);          }          

What is nodeValue property in JavaScript HTML DOM?

Vikyath Ram
Updated on 22-May-2020 11:15:51

329 Views

The nodeValue property is used to get the node value. You need to specify the node.ExampleYou can try to run the following code to learn how to get nodeValue property.Live Demo           Get the node value       Demo Button Text                var val = document.getElementsByTagName("BUTTON")[0];          var res = val.childNodes[0].nodeValue;          document.write("Node Value: "+res);          

What is the usage of onfocus event in JavaScript?

Govinda Sai
Updated on 22-May-2020 11:12:41

627 Views

The onfocus event is triggered when element gets focus. You can try to run the following code to learn how to implement onfocus event in JavaScript.Example           Write below:                      function newFunc(x) {             x.style.background = "blue";          }          

What is the usage of onblur event in JavaScript?

Nishtha Thakur
Updated on 22-May-2020 11:11:53

917 Views

The blur event triggers when object lose focus. You can try to run the following code to learn how to implement onblur event in JavaScript.Example           Write below:                      function newFunc(a) {             a.style.background = "green";          }          

Advertisements