Javascript Articles - Page 580 of 671

What is the usage of onfocusout event in JavaScript?

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

270 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

293 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

209 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

180 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

592 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

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

How to change the value of an attribute in javascript?

Shubham Vora
Updated on 08-Aug-2022 08:36:09

23K+ Views

In this tutorial, we will learn to change the value of an attribute in JavaScript. To build web applications, the most programmer uses three languages. HTML, CSS, and JavaScript. The HTML is used to create the base for the web page, CSS for styling, and JavaScript adds the dynamic behaviours to the web page. Users have seen on many websites that it changes the element's style when they just click on the button. We can make it happen using JavaScript. Using JavaScript, let’s look at setting the new attribute for the HTML element or changing the attribute values dynamically. To ... Read More

What is the usage of onunload event in JavaScript?

Sai Nath
Updated on 21-May-2020 07:51:06

359 Views

The unload event trigger when you unload (or refresh) a page. You can try to run the following code to learn how to implement onunload event in JavaScript.Example           Close the page and see what happens!       This event may give unexpected results.                function newFunc() {             alert("Thank you!");          }          

How to work with document.title in JavaScript?

Lakshmi Srinivas
Updated on 21-May-2020 07:49:29

313 Views

Use the document.title property to set the title of the document in JavaScript.ExampleYou can try to run the following code to implement document.title property in JavaScript.Live Demo           Demo Title                        var x = document.title;          document.write("Our Title: "+x);          

What is the usage of onresize event in JavaScript?

Ramu Prasad
Updated on 21-May-2020 07:48:58

269 Views

The resize event is triggered when the window is resized. Use window.outerWidth and window.outerHeight event in JavaScript to get the size of windows when the browser is resized.ExampleYou can try to run the following code to work with an onresize event in JavaScript.                    function resizeFunction() {             var val = "Window Width=" + window.outerWidth + ", Window Height=" + window.outerHeight;             document.getElementById("test").innerHTML = val;          }                     Resize browser window and check the window (browser window) height and width again.                

Advertisements