Found 10877 Articles for Web Development

How to create a link from a text using JavaScript?

Manikanth Mani
Updated on 15-Jun-2020 06:54:37

2K+ Views

To create a link, use the JavaScript link() method. This method creates an HTML hypertext link that requests another URL. The following is the syntax:string.link( hrefname )Above, hrefname is any string that specifies the HREF of the tag; it should be a valid URL.ExampleYou can try to run the following code to learn how to work with link() method in JavaScript −Live Demo           JavaScript String link() Method                        var str = new String("Simply Easy Learning");          var URL = "http://www.tutorialspoint.com";          document.write(str.link( URL ));          

How to change string to be displayed as a subscript using JavaScript?

Shubham Vora
Updated on 02-Aug-2022 11:32:20

2K+ Views

In this tutorial, we will learn to change the string displayed as a subscript using JavaScript. The meaning of the subscript string is a string that displays right after the string with a small letter and hangs below. For example, In the Astart, ‘start’ is the subscript string shown in the small letter right after A and hangs below. The substring uses in many fields such as Mathematics, chemicals, etc. It is useful to represent the chemical name. For example, H2, N2, O2, etc. Also, we can use it in mathematics to show the symbols such as X2, A2, etc. ... Read More

How to create a small font text using JavaScript?

Anjana
Updated on 15-Jun-2020 06:52:29

467 Views

To create a small font text with JavaScript, use the small() method. This method causes a string to be displayed in a small font as if it were in a tag.ExampleYou can try to run the following code to create a small font using JavaScript −Live Demo           JavaScript String small() Method                        var str = new String("Demo Text");          document.write(str.small())          alert(str.small());          

How to create a strikethrough text using JavaScript?

Akshaya Akki
Updated on 15-Jun-2020 06:52:04

4K+ Views

To create a strikethrough text with JavaScript, use the strike() method. This method causes a string to be displayed as struck-out text as if it were in a tag.ExampleYou can try to run the following code to create a strikethrough text −Live Demo           JavaScript String strike() Method                        var str = new String("Demo Text");          document.write(str.strike());          alert(str.strike());          

How to make a text italic using JavaScript

Shubham Vora
Updated on 20-Oct-2022 07:20:05

3K+ Views

In this tutorial, we will learn to make a text italic using JavaScript. We give the italic property to a text to differentiate it from other text within the sentence. In HTML, we can make a text italic by just adding the text within the 'i' tag. But sometimes, we have to make it dynamic, that not possible with HTML. Then, we have to use a programming language like JavaScript to make the text italic. Let's have a look at how to make a text italic using JavaScript. Following are the ways by which we can make a ... Read More

How to change the font size of a text using JavaScript?

Shubham Vora
Updated on 08-Aug-2022 08:32:48

6K+ Views

In this tutorial, programmers will learn to change the font size of the text using JavaScript. Many application allows users to change the font size according to users’ requirement. We need to change the default font size using JavaScript to achieve that. Before we move ahead with the tutorial, let’s learn what values we can assign to the fontsize. Different values users can assign to the font size We can assign the below values to the font size of any element. Every values changes the font size differently which we have explained here. xx-large | x-large | large | ... Read More

How to change the font color of a text using JavaScript?

Shubham Vora
Updated on 12-Sep-2023 01:06:22

35K+ Views

This tutorial teaches us to change the font color of the text using JavaScript. While working with JavaScript and developing the frontend of the application, it needs to change the font color of the text using JavaScript when an event occurs. For example, we have an application which can turn on or off the device. We have a button to turn on or off the device. When the device is on, make the button text green. Otherwise, make the button text red. So, in such cases, programmers need to change the font color using JavaScript. We have some different method ... Read More

How to create a bold text using JavaScript?

Anjana
Updated on 15-Jun-2020 06:48:12

17K+ Views

To create a bold text using JavaScript, use the bold() text. This method causes a string to be displayed as bold as if it were in a tag.ExampleYou can try to run the following code to create a bold text with JavaScript −Live Demo           JavaScript String bold() Method                        var str = new String("Demo Text");          document.write(str.bold());          alert(str.bold());          

How to convert a string into the lower case using JavaScript?

Shubham Vora
Updated on 08-Aug-2022 09:08:41

1K+ Views

This tutorial will teach us to convert the string into the lower case. Programmers can ask themselves why they need to convert the string in the lower case? Let’s understand the answer using the single example. Suppose you are developing the application and need to take input from the user using the form or either way. Users can type the text in upper case, lower case, or a mix of both. Also, you have stored some values in the lower case in your database, and you need to match them with the user input. If you match the input string ... Read More

How to convert a string into upper case using JavaScript?

Shubham Vora
Updated on 08-Aug-2022 09:10:25

2K+ Views

This tutorial will teach us to convert the string into the upper case. In many governments, websites users have seen while filling forms, characters are automatically converted into the upper case to avoid any mistakes. It needs to do because JavaScript is a case-sensitive language, and if the user adds some characters in lower case and some in upper case, it can mismatch with the string stored in the database. To get accurate data from the user, it is needful to convert the string to uppercase. Here, we will learn the different methods to convert the string into the upper ... Read More

Advertisements