Javascript Articles - Page 572 of 671

How to use JavaScript DOM to change the padding of a table?

Abhishek
Updated on 25-Nov-2022 08:01:56

1K+ Views

In this tutorial, we learn to use JavaScript DOM to change the padding of a table. To change the padding of a table, use the DOM padding property. The HTML table is used to display the relational data on the user screen. We can easily show the related or dependent data to the user and user can easily understand and determine the characteristics of the data with help of table. But, while we are showing the relational data to the user in the form of table, we need to make sure that the table is well structured and looking good ... Read More

How to set the width of the bottom border with JavaScript?

Shubham Vora
Updated on 22-Nov-2022 07:46:37

373 Views

In this tutorial, we shall learn to set the width of the bottom border with JavaScript. To set the width of the bottom border, we can use the borderBottomWidth property in JavaScript. It allows you to change the width. Let us discuss our topic in brief. Using the borderBottomWidth Property With this property, we can set or return the width of an element's bottom border. Width is a floating point number with either a relative units designator (cm, mm, in, pt, or pc) or an absolute units designator (em, ex, or px). Syntax Following is the syntax to set the ... Read More

Set whether the table border should be collapsed into a single border or not with JavaScript?

Shubham Vora
Updated on 15-Nov-2022 10:35:38

498 Views

In this tutorial, let us look at how to set whether the table border should collapse into a single table border or not with JavaScript. We can use the borderCollapse property in JavaScript to accomplish this. Let us look into this in brief. Using the Style borderCollapse Property The borderCollapse property defines whether the table border should collapse into a single table border or separate into a double table border. The value 'separate' is the default. The borderCollapse is a read-and-write property. Users can follow the syntax below to use the borderCollapse property. Syntax object.style.borderCollapse = "separate|collapse|initial|inherit|revert|unset" The syntax ... Read More

How to get the value of the usemap attribute of an image with JavaScript?

Sravani S
Updated on 23-Jun-2020 11:03:29

210 Views

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);          

How to set the size of the background image with JavaScript?

Shubham Vora
Updated on 22-Nov-2022 07:23:00

6K+ Views

In this tutorial, we will look at the method to set the size of a background image with JavaScript. Background effects on a webpage enhance its look. We can set a background color or a background image to enhance the feel of the webpage. We can also change the background properties, like its size or color. To enhance the feel, the image must fit in the right position with the right size. Generally, we do this by using CSS, but JavaScript DOM also provides properties to do so. So, let us look at how to set the size of the ... Read More

How to set border width, border style, and border color in one declaration with JavaScript?

Paul Richard
Updated on 23-Jun-2020 11:06:22

995 Views

To set the border width, style, and color in a single declaration, use the border property in JavaScript.ExampleYou can try to run the following code to learn how to set border in JavaScript −Live Demo           Set border                Demo Text          Demo Text                      function display() {             document.getElementById("box").style.border = "thick dashed #000000";          }          

How to set all the border bottom properties in one declaration in JavaScript DOM?

Lakshmi Srinivas
Updated on 23-Jun-2020 11:07:31

161 Views

To set the border bottom properties in one declaration in JavaScript, use the borderBottom property. It allows you to set the border-bottom-width, border-bottom-style, and border-bottom-color.ExampleYou can try to run the following code to learn how to set border bottom properties −Live Demo                    #box {             border: 2px dashed blue;             width: 120px;             height: 120px;          }                     Set border bottom color                Demo Text          Demo Text                      function display() {             document.getElementById("box").style.borderBottom = "thin dashed #000000";          }          

What will happen when ["demo"] is converted to Number in JavaScript?

karthikeya Boyini
Updated on 23-Jun-2020 09:58:50

110 Views

Use the Number() method in JavaScript to convert to Number. You can try to run the following code to learn how to convert ["demo"] to Number in JavaScript −ExampleLive Demo           Convert ["demo"] to Number                var myVal = ["demo"];          document.write("Number: " + Number(myVal));          

How to set the shape of the border of the top-left corner with JavaScript?

Shubham Vora
Updated on 12-Oct-2022 10:47:31

341 Views

In this tutorial, we will learn to set the radius of the top-left corner of the border using JavaScript DOM. To set the shape of the border of the top-left corner in JavaScript, use the borderTopLeftRadius property. Set the border radius using this property. We apply borders on a webpage many times. Generally, it is used to display the importance of an element or a difference between the sections. We can create a table in a webpage by using HTML. It is a simple table that does not attract the user. So, we use CSS to design the table or ... Read More

How to set the color of the top border with JavaScript?

Shubham Vora
Updated on 09-Nov-2022 11:29:03

612 Views

In this tutorial, we will learn how to set the color of the top border with JavaScript. The HTML element’s outline is called the border. The border of an element can have multiple colors on each side. Different properties and methods are used to color each side of the border. To set the color of the top border with JavaScript, we have different ways − Using the style.borderTopColor Property Using the style.borderColor Property Using the style.borderTopColor Property The style.borderTopColor property of an element in JavaScript is used to specify the color of the element's top border. The style.borderTopColor ... Read More

Advertisements