Found 601 Articles for Front End Scripts

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

Sai Subramanyam
Updated on 23-Jun-2020 13:20:09

544 Views

Use the maxHeight property in JavaScript to set the maximum height. You can try to run the following code to set the maximum height of an element with JavaScript −ExampleLive Demo    #box {       width: 300px;       background-color: gray;       overflow: auto;    } Click below to set Maximum height. Max Height 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 ... Read More

How to set the position of the list-item marker with JavaScript?

Jai Janardhan
Updated on 23-Jun-2020 13:20:40

123 Views

To set the position of the marker of the list-item, use the listStylePosition property. You can try to run the following code to set the position of the list-item marker with JavaScript −ExampleLive Demo                    One          Two             Add list inside       Add list outside                function displayInside() {             document.getElementById("myID").style.listStylePosition = "inside";          }          function displayOutside() {             document.getElementById("myID").style.listStylePosition = "outside";          }          

How to set an image as the list-item marker with JavaScript?

Monica Mona
Updated on 23-Jun-2020 13:21:08

125 Views

To set an image as the marker in list-item, use the listStyleImage property in JavaScript.ExampleYou can try to run the following code to set an image as the list-item marker with JavaScript −Live Demo                    One          Two             Update list image                function display() {             document.getElementById("myID").style.listStyleImage = "url('http://tutorialspoint.com/css/images/bullet.gif')";          }          

How to set the distance between lines in a text with JavaScript?

Paul Richard
Updated on 23-Jun-2020 13:22:18

373 Views

To set the distance between lines, use the lineHeight property. You can try to run the following code to set the distance between lines in a text with JavaScript −ExampleLive Demo           Heading 1       This is Demo Text.This is Demo TextThis is Demo Text       Set distance between lines                function display() {             document.getElementById("myID").style.lineHeight = "2";          }          

How to set listStyleImage, listStylePosition, and listStyleType in one declaration with JavaScript?

Sharon Christine
Updated on 23-Jun-2020 13:03:09

61 Views

To set the list properties in a single declaration, use the listStyle property in JavaScript.ExampleYou can try to run the following code to set the listStylePosition and listStyleType property in one declaration with JavaScript −Live Demo                    One          Two             Change style                function display() {             document.getElementById("myID").style.listStyle = "circle outside";          }          

How to set the space between characters in a text with JavaScript?

Samual Sam
Updated on 23-Jun-2020 13:05:42

338 Views

To set the space between characters, use the JavaScript letterSpacing property.ExampleYou can try to run the following code to set the space between characters in a text with JavaScript −Live Demo           Heading 1       This is Demo Text.       Set Space between characters                function display() {             document.getElementById("myID").style.letterSpacing = "7px";          }          

How to preserve the readability of text when font fallback occurs with JavaScript?

Kumar Varma
Updated on 23-Jun-2020 13:06:14

111 Views

Use the fontSizeAdjust property to preserve the readability of text. It sets the aspect value of a font i.e. the difference between the size of lowercase and uppercase letters.ExampleYou can try to run the following code to preserve the readability of text when font fallback occurs with JavaScript −Live Demo           Heading 1                This is Demo Text.             Set Aspect Value                function display() {             document.getElementById("myID").style.fontFamily = "verdana,sans-serif";             document.getElementById("myP").style.fontSizeAdjust = "0.90";          }          

How to set the height of an element with JavaScript?

Lakshmi Srinivas
Updated on 23-Jun-2020 13:06:43

663 Views

Use the height property to set the height of an element. You can try to run the following code to set the height of a button with JavaScript −ExampleLive Demo           Heading 1       This is Demo Text.       Update Height                function display() {             document.getElementById("myID").style.height = "100px";          }          

How to set the boldness of the font with JavaScript?

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

82 Views

Use the fontWeight property in JavaScript to set the font boldness.ExampleYou can try to run the following code to set the boldness of the font with JavaScript −Live Demo           Heading 1                This is Demo Text.             Set Font Family and Font Weight                function display() {             document.getElementById("myID").style.fontFamily = "verdana,sans-serif";             document.getElementById("myID").style.fontWeight = "800";          }          

How to set the font to be displayed in small capital letters with JavaScript?

Swarali Sree
Updated on 23-Jun-2020 12:56:31

126 Views

To set the font in small capital letters, use the fontVariant property.ExampleYou can try to run the following code to set the font to be displayed in small capital letters with JavaScript −Live Demo           Heading 1                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.             Set Font Family and Font Variant                function display() {             document.getElementById("myID").style.fontFamily = "verdana,sans-serif";             document.getElementById("myID").style.fontVariant = "small-caps";          }          

Advertisements