Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Programming Scripts Articles
Found 328 articles
What is nodeValue property in JavaScript HTML DOM?
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. Get the node value Demo Button Text var val = document.getElementsByTagName("BUTTON")[0]; var res = val.childNodes[0].nodeValue; document.write("Node Value: "+res);
Read MoreHow -Infinity is converted to Number in JavaScript?
Use the Number() method in JavaScript to convert to Number. You can try to run the following code to learn how to convert -Infinity Number in JavaScript.Example Convert -Infinity to Number var myVal = -Infinity; document.write("Number : " + Number(myVal)); OutputConvert -Infinity to Number Number : -Infinity
Read MoreWhat will happen when [50,100] is converted to Number in JavaScript?
Use the Number() method in JavaScript to convert to Number. You can try to run the following code to learn how to convert [50, 100] to Number in JavaScript − Example Live Demo Convert [50,100] to Number var myVal = [50,100]; document.write("Number: " + Number(myVal));
Read MoreHow to show all the options from a dropdown list with JavaScript?
To show all the options from a dropdown list, use the options property. The property allows you to get all the options with length property.ExampleYou can try to run the following code to get all the options from a drop-down list. One Two Three Click the button to get all the options function display() { var a, i, options; a = document.getElementById("selectNow"); options = ""; for (i = 0; i < a.length; i++) { options = options + " " + a.options[i].text; } document.write("DropDown Options: "+options); }
Read MoreHow to get the value of the type attribute of a link in JavaScript?
To get the value of the type attribute of a link in JavaScript, use the type property. The type attribute is used to tell that the document is html (text/html) or css (text/css), etc.ExampleYou can try to run the following code to get the value of the type attribute of a link. Qries var myVal = document.getElementById("anchorid").type; document.write("Value of type attribute: "+myVal);
Read MoreHow to work with document.embeds in JavaScript?
Use the document.embeds property in JavaScript to get the number of tags in a document.ExampleYou can try to run the following code to implement document.embeds property in JavaScript. JavaScript Example var num = document.embeds.length; document.write("How many embed tags: "+num);
Read MoreHow to work with document.images in JavaScript?
Use the document.images property in JavaScript to get the number of tags in a document.ExampleYou can try to run the following code to implement document.images property in JavaScript. JavaScript Example TutorialsPoint Tutorials var num = document.images.length; document.write("How many images? "+num);
Read MoreHow to set the shape of the border of the top-right corner with JavaScript?
To set the shape of the border of the top-right corner in JavaScript, use the borderTopRightRadius property. Set border radius using this property.ExampleYou can try to run the following code to learn how to set the shape of the top-right border with JavaScript. #box { border: thick solid gray; width: 300px; height: 200px } Demo Text Change top right border radius function display() { document.getElementById("box").style.borderTopRightRadius = "20px"; }
Read MoreHow to set all the background properties in one declaration with JavaScript DOM?
To set the background in JavaScript, use the background property. It allows you to set the background color, image, position, etc.ExampleYou can try to run the following code to learn how to set all the background properties in a single declaration with JavaScript. Click to Set background function display() { document.body.style.background = "url('https://www.tutorialspoint.com/html5/images/html5-mini-logo.jpg') repeat right top"; }
Read MoreHow to set the starting position of a background image in JavaScript DOM?
To set the starting position of a background image in JavaScript, use the backgroundposition property. It allows you to set the position of the image.ExampleYou can try to run the following code to learn how to set all the position of a background image with JavaScript − body { background-repeat: no-repeat; } Click to Set background image function display() { document.body.style.backgroundImage = "url('https://www.tutorialspoint.com/html5/images/html5-mini-logo.jpg')"; document.body.style.backgroundPosition="top right"; }
Read More