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
Javascript Articles
Page 462 of 534
How to set the left padding of an element with JavaScript?
Use the paddingLeft property in JavaScript to set the left padding. You can try to run the following code to return the left padding of an element with JavaScript −Example #box { border: 2px solid #FF0000; width: 150px; height: 70px; } This is demo text. Left padding function display() { document.getElementById("box").style.paddingLeft = "100px"; }
Read MoreHow to set the style of the bottom border with JavaScript?
To set the style of the bottom border, use the JavaScript borderBottomStyle property. It allows you to add a bottom border.ExampleYou can try to run the following code to set the style of the bottom border − Demo Text Click to set style of bottom border function display() { document.getElementById("box").style.borderBottomStyle = "dashed"; }
Read MoreHow to set all the four border radius properties at once with JavaScript?
To set all the border-radius properties in JavaScript, use the borderRadius property. Set the border-radius properties at once using this. Example You can try to run the following code to learn how to set all the four border-radius properties − #box { border: thick solid gray; width: 200px; height: 200px } Demo Text Add border radius function display() { document.getElementById("box").style.borderRadius = "20px"; }
Read MoreHow to set border width, border style, and border color in one declaration with JavaScript?
To set the border width, style, and color in a single declaration, use the border property in JavaScript. Example You can try to run the following code to learn how to set border in JavaScript − Set border Demo Text Demo Text function display() { document.getElementById("box").style.border = "thick dashed #000000"; }
Read MoreHow to get the value of the usemap attribute of an image with JavaScript?
To get the value of the usemap attribute of an image, use the useMap property. You can try to run the following code to display the usemap attribute value −Example var x = document.getElementById("myid").useMap; document.write("Usemap: "+x);
Read MoreWith JavaScript how to change the width of a table border?
To change the width of a table border, use the DOM border property. You can try to run the following code to change the width of a table border in JavaScript −Example function borderFunc(x) { document.getElementById(x).style.border = "5px dashed blue"; } One Two Three Four Five Six
Read MoreHow to search the querystring part of the href attribute of an area in JavaScript?
To get the querystring of the href attribute of an area, use the search property. You can try to run the following code to search the querystring −Example var x = document.getElementById("myarea").search; document.write("Querystring: "+x);
Read MoreWhat will happen when 0 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 0 to Number in JavaScript − Example Convert 0 to Number var myVal = 0; document.write("Number: " + Number(myVal));
Read MoreHow to set a background image to be fixed with JavaScript DOM?
To set the background image to be fixed in JavaScript, use the backgroundAttachment property. It allows you to set an image that won't scroll. Example You can try to run the following code to learn how to work with backgroundAttachment property with JavaScript – Click to Set background Demo Text Demo Text Demo Text Demo Text Demo Text Demo Text Demo Text Demo Text Demo Text Demo Text Demo Text Demo Text Demo Text Demo Text Demo Text Demo Text function display() { document.body.style.background = "url('https://www.tutorialspoint.com/html5/images/html5-mini-logo.jpg') no-repeat right top"; document.body.style.backgroundAttachment = "fixed"; } ...
Read MoreWhat will happen when 1 is converted to Boolean in JavaScript?
You can try to run the following code to learn how to convert 1 to Boolean in JavaScript − Example Convert 1 to Boolean var myVal = 1; document.write("Boolean: " + Boolean(myVal));
Read More