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
-
Economics & Finance
Javascript Articles
Page 8 of 534
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 use JavaScript to set cookies for homepage only?
To set cookies for a homepage, add the page to the homepage itself.ExampleYou can try to run the following code to set cookies Enter name:
Read MoreHow to show image in alert box using JavaScript?
To show an image in alert box, try to run the following code. Here, an alert image is added to the custom alert box −Example function functionAlert(msg, myYes) { var confirmBox = $("#confirm"); confirmBox.find(".message").text(msg); confirmBox.find(".yes").unbind().click(function() { confirmBox.hide(); }); confirmBox.find(".yes").click(myYes); ...
Read MoreWhy does the JavaScript void statement evaluate an expression?
The JavaScript void returns an expression to remove the side effect and return the undefined primitive value. This side effect may occur while inserting expression in a web page.Let’s see an example of the void. The void(0) can be used with hyperlinks to obtain the undefined primitive value, Example Understanding JavaScript void(0) Click me not once, but twice. We used JavaScript:void(0) above to prevent the page from reloading when the button is clicked the first time.The code will only ...
Read MoreHow to customize the position of an alert box using JavaScript?
To customize the position of an alert box, use the CSS “top” and “left” properties. We have a custom alert box, which we’ve created using jQuery and styled with CSS.ExampleYou can try to run the following code to customize the position of an alert box − function functionAlert(msg, myYes) { var confirmBox = $("#confirm"); confirmBox.find(".message").text(msg); confirmBox.find(".yes").unbind().click(function() { confirmBox.hide(); ...
Read MoreWhat is the difference between an acronym and abbr tags?
In layman language, an acronym is a word formed by taking letters of each word in a phrase to form an abbreviation. Acronyms are a subset of abbreviations i.e. abbreviation is a shortened form of a word.The tag isn’t supported in HTML5 and is deprecated now. Do not use. To add abbreviation in HTML, use the tag. Both abbreviation and acronym are the shortened versions and are represented as a series of letters. Some of the examples include, "Mr.", "IST", "MRI", “NASA”, “ISRO” etc. ExampleYou can try to run the following code to add abbreviation in HTML. ...
Read MoreHow to use the tag to define a relationship to an external resource?
The tag is used in HTML to define a relationship to an external resource. It is used to link external style sheets. It gets added inside the … tag, but does not have a closing tag. Define your external CSS file in it.The CSS file created separately will have all the CSS code inside it. The href attribute adds the css file link.You can try to run the following code to include external CSS in HTML. The HTML file is here, with a link to CSS file style.cssExample ...
Read MoreHow do we upload external file on a website using HTML forms?
If you want to allow a user to upload an external file to your website, you need to use a file upload box, also known as a file select box. This is also created using the element but type attribute is set to file.ExampleYou can try to run the following code to upload an external file to your website − File Upload Here are the attributes of the file upload box −Sr.NoAttribute & Description1nameUsed ...
Read More