Found 601 Articles for Front End Scripts

How to set all the outline properties in one declaration with JavaScript?

Monica Mona
Updated on 23-Jun-2020 13:23:32

99 Views

To set outline properties, use the outline property. It allows you to set the color, style, and offset of the outline.ExampleYou can try to run the following code to set all the outline properties in one declaration with JavaScript −Live Demo                    #box {             width: 450px;             background-color: orange;             border: 3px solid red;          }                     Click below to add ... Read More

How to set the opacity level for an element with JavaScript?

Sharon Christine
Updated on 23-Jun-2020 13:27:01

482 Views

Use the opacity property in JavaScript to set the opacity level. You can try to run the following code to set the opacity level for an element with JavaScript −ExampleLive Demo                    #box {             width: 450px;             background-color: gray;          }                     Click below to set Opacity.       Set Opacity                This is a div. This is a ... Read More

How to set the minimum width of an element with JavaScript?

Rishi Raj
Updated on 23-Jun-2020 13:25:42

731 Views

Use the minWidth property in JavaScript to set the minimum width. You can try to run the following code to set the minimum width of an element with JavaScript −ExampleLive Demo                    #box {             width: 50%;             background-color: gray;          }                     Click below to set Minimum width.       Min Width                This is a div. This ... Read More

How to set the minimum height of an element with JavaScript?

Kumar Varma
Updated on 23-Jun-2020 13:29:03

489 Views

Use the minHeight property in JavaScript to set the maximum height. You can try to run the following code to set the minimum height of an element with JavaScript −ExampleLive Demo                    #box {             width: 300px;             background-color: gray;             overflow: auto;          }                     Click below to set Minimum height.       Min Height         ... Read More

How to set the maximum width of an element with JavaScript?

Samual Sam
Updated on 23-Jun-2020 13:27:41

2K+ Views

Use the maxWidth property in JavaScript to set the maximum width.ExampleYou can try to run the following code to set the maximum width of an element with JavaScript −Live Demo           Click below to set Maximum width.       Max Width                This is a div. This is a div. This is a div.          This is a div. This is a div. This is a div.          This is a div. This is a div. This is a div.   ... Read More

How to set the right margin of an element with JavaScript?

Jai Janardhan
Updated on 23-Jun-2020 13:29:34

384 Views

Use the marginRight property in JavaScript, to set the right margin. You can try to run the following code to set the right margin of an element with JavaScript −ExampleLive Demo                    #myID {             border: 2px solid #000000;          }                     This is demo text.       Add right margin                function display() {             document.getElementById("myID").style.marginRight = "150px";          }          

How to set the top margin of an element with JavaScript?

Lakshmi Srinivas
Updated on 24-Jan-2020 06:37:27

1K+ Views

Use the marginTop property in JavaScript, to set the top margin. Can you try to run the following code to set the top margin of an element with JavaScript?ExampleLive Demo                    #myID {             border: 2px solid #000000;          }                     This is demo text.       Add top margin                function display() {             document.getElementById("myID").style.marginTop = "150px";          }          

How to set the bottom margin of an element with JavaScript?

karthikeya Boyini
Updated on 23-Jun-2020 13:18:11

513 Views

Use the marginBottom property in JavaScript, to set the bottom margin.ExampleYou can try to run the following code to set the bottom margin of an element with JavaScript −Live Demo           This is demo text.       Set bottom margin                function display() {             document.getElementById("myID").style.marginBottom = "95px";          }          

How to set the list-item marker type with JavaScript?

Fendadis John
Updated on 23-Jun-2020 13:18:44

318 Views

To set the type of the list-item marker type, use the listStyleType property. The marker type can be square, circle, dic, etc.ExampleYou can try to run the following code to set the list-item marker type with JavaScript −Live Demo                    One          Two             Update list style type (square)       Update list style type (decimal)                function displaySquare() {             document.getElementById("myID").style.listStyleType = "square";          }          function displayDecimal() {             document.getElementById("myID").style.listStyleType = "decimal";          }          

How to set the margins of an element with JavaScript?

Swarali Sree
Updated on 23-Jun-2020 13:19:12

169 Views

Use the margin property in JavaScript, to set the margins. You can try to run the following code to set the margins of an element with JavaScript −ExampleLive Demo           Set all four margins       This is demo text.                function display() {             document.getElementById("myID").style.margin = "30px 20px 40px 40px";          }          

Advertisements