Found 2556 Articles for HTML

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

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

72 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

243 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

241 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

195 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

241 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 the usage of onfocusout event in JavaScript?

Abhinaya
Updated on 22-May-2020 11:16:24

201 Views

The onfocusin event triggers when an element is to lose focus. You can try to run the following code to learn how to implement onfocusout event in JavaScript.Example           Write below:       After losing focus, the background color of input check will change.                      function newFunc(x) {             x.style.background = "blue";          }          

What is nodeValue property in JavaScript HTML DOM?

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

176 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 nodeName property in JavaScript HTML DOM?

Samual Sam
Updated on 22-May-2020 11:15:12

119 Views

The nodeName property in JavaScript is used to specify the name of a node.ExampleYou can try to run the following code to learn how to implement a nodeName property in JavaScript.Live Demo           Tutorials       Demo Content                            document.getElementById("id3").innerHTML = document.getElementById("id1").nodeName;          document.getElementById("id4").innerHTML = document.getElementById("id2").nodeName;          

What is the usage of onfocusin event in JavaScript?

Manikanth Mani
Updated on 23-Jun-2020 09:06:49

109 Views

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

What is the usage of onfocus event in JavaScript?

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

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

Advertisements