Front End Technology Articles

Page 509 of 652

HTML DOM Meter value Property

AmitDiwan
AmitDiwan
Updated on 23-Jun-2020 162 Views

The HTML DOM Meter value property returns/sets a number corresponding to the value attribute of a element. Use this with high, low, min and max attributes for better results.NOTE: Don’t use as a progress bar but only as a gauge.Following is the syntax −Returning value of the value propertymeterElementObject.valueValue of the value property setmeterElementObject.value = numberLet us see an example of Meter value property −Example Live Demo Meter value    form {       width:70%;       margin: 0 auto;       text-align: center;    }    * {       padding: 2px; ...

Read More

How to set the CSS property that the transition effect is for with JavaScript?

Nitya Raut
Nitya Raut
Updated on 23-Jun-2020 195 Views

Use the transitionProperty in JavaScript to set the CSS property. You can try to run the following code to return the CSS property that the transition effect is for with JavaScript −Example                    #div1 {             position: relative;             margin: 10px;             height: 300px;             width: 400px;             padding: 20px;             border: 2px solid blue;          }          #div2 {             padding: 80px;             position: absolute;             border: 2px solid BLUE;             background-color: yellow;             transform: rotateY(45deg);             transition: all 3s;          }          #div2:hover {             background-color: orange;             width: 50px;             height: 50px;             padding: 100px;             border-radius: 50px;          }                     Hover over DIV2       Set       DIV1          DIV2                      function display() {             document.getElementById("div2").style.transitionProperty = "width,height";          }          

Read More

How to set the horizontal alignment of text with JavaScript?

Srinivas Gorla
Srinivas Gorla
Updated on 23-Jun-2020 849 Views

Use the textAlign property in JavaScript and set it to right for aligning it horizontally. You can try to run the following code to return the horizontal alignment of text with JavaScript −Example           This is demo text       Set Horizontal Alignment                function display() {             document.getElementById("myText").style.textAlign = "right";          }          

Read More

How to set how the last line of a block or a line right before a forced line break is aligned when text-align is "justify" with JavaScript?

Smita Kapse
Smita Kapse
Updated on 23-Jun-2020 408 Views

Use the textAlignLast property in JavaScript to set the last line to right. Set it to right and allow the right alignment.ExampleYou can try to run the following code to return how the last line of a block or a line right before a forced line break is aligned when text-align is "justify" with JavaScript −                    #myDIV {             text-align: justify;          }                              This is ...

Read More

How to set the decoration of a text with JavaScript?

Nikitha N
Nikitha N
Updated on 23-Jun-2020 1K+ Views

Use the textDecoration property in JavaScript to decorate the text. You can underline a text using this property.ExampleYou can try to run the following code to set the decoration of a text with JavaScript −           This is demo text.       Set Text Decoration                function display() {             document.getElementById("myText").style.textDecoration = "underline";          }          

Read More

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

Priya Pallavi
Priya Pallavi
Updated on 23-Jun-2020 663 Views

Use the paddingTop property in JavaScript to set the top padding. You can try to run the following code to set the top padding of an element with JavaScript −Example                    #box {             border: 2px solid #FF0000;             width: 150px;             height: 70px;          }                     This is demo text.             Top Padding                      function display() {             document.getElementById("box").style.paddingTop = "20px";          }          

Read More

How to set the shadow effect of a text with JavaScript?

Sravani S
Sravani S
Updated on 23-Jun-2020 985 Views

To set the shadow effect, use the textShadow property in JavaScript.ExampleYou can try to run the following code to return the shadow effect of a text with JavaScript −           Set Text Shadow                This is Demo Text! This is Demo Text! This is This is Demo Text! This is Demo Text! This is Demo Text! This is Demo Text! This is Demo Text! This is Demo Text! This is Demo Text! This is Demo Text! This is Demo Text!                      function display() {             document.getElementById("myID").style.textShadow = "2px 2px 2px #ff0000,20px 5px 2px #F1F1F1";          }          

Read More

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

Abhinaya
Abhinaya
Updated on 23-Jun-2020 731 Views

To set the bottom padding, use the paddingBottom property in JavaScript.ExampleYou can try to run the following code to return the bottom padding of an element with JavaScript −                    #box {             border: 2px solid #FF0000;             width: 150px;             height: 70px;          }                     This is demo text.                   Bottom padding                      function display() {             document.getElementById("box").style.paddingBottom = "100px";          }          

Read More

How to set the left padding of an element with JavaScript?

Anvi Jain
Anvi Jain
Updated on 23-Jun-2020 741 Views

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 More

With JavaScript how to change the width of a table border?

Nitya Raut
Nitya Raut
Updated on 23-Jun-2020 1K+ Views

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 More
Showing 5081–5090 of 6,517 articles
« Prev 1 507 508 509 510 511 652 Next »
Advertisements