Found 444 Articles for Programming Scripts

How [ ] is converted to Number in JavaScript?

Lakshmi Srinivas
Updated on 23-May-2020 09:15:26

185 Views

Use the Number() method in JavaScript to convert to Number. You can try to run the following code to learn how to convert [ ] to Number in JavaScript.ExampleLive Demo           Convert [] to Number                var myVal = [];          document.write("Number: " + Number(myVal));          

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

Vrundesha Joshi
Updated on 23-May-2020 09:14:49

110 Views

The onpaste event occurs when you paste content in the element.ExampleYou can try to run the following code to learn how to work with onpaste event in JavaScript.                          function pasteFunction() {             document.write("Text pasted successfully!");          }          

What is the role of altKey Mouse Event in JavaScript?

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

207 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

122 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

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

Which event occurs in JavaScript when an element is dragged completely?

Ayyan
Updated on 22-May-2020 11:30:29

83 Views

The ondragend event triggers when an element is dragged completely.ExampleYou can try to run the following code to learn how to implement ondragend event in JavaScript.                    .drag {             float: left;             width: 100px;             height: 35px;             border: 2px dashed #876587;             margin: 15px;             padding: 10px;          }             ... Read More

Which event occurs in JavaScript when the dragging of an element begins?

Ankitha Reddy
Updated on 30-Jul-2019 22:30:21

148 Views

The ondragstart event triggers when dragging of an element begins.You can try to run the following code to learn how to implement ondragstart JavaScript event − Example Live Demo .drag { float: left; width: 100px; height: 35px; ... Read More

Which event occurs in JavaScript when an element is getting dragged?

Anvi Jain
Updated on 22-May-2020 11:28:34

124 Views

Use the ondrag event in JavaScript to drag an element. The ondrag event is triggered when an element is dragged.ExampleYou can try to run the following code to learn how to work with ondrag event in JavaScript.                    .drag {             float: left;             width: 100px;             height: 35px;             border: 2px dashed #876587;             margin: 15px;             padding: 10px;     ... Read More

What is the usage of onsearch event in JavaScript?

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

340 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

349 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:                    

Advertisements