

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to change the font size of a text using JavaScript?
This method causes a string to be displayed in the specified size as if it were in a <font size= "size"> tag.
Example
You can try to run the following code to change the font size of a text using JavaScript −
<html> <head> <title>JavaScript String fontsize() Method</title> </head> <body> <script> var str = new String("Demo Text"); document.write(str.fontsize(10)); alert(str.fontsize( 10 )); </script> </body> </html>
- Related Questions & Answers
- How to change the font color of a text using JavaScript?
- How to set the font size of text with JavaScript?
- JavaScript: How to allow users to change the font-size of a webpage?
- How to increase the font size of a Text widget?
- How to change PowerShell ISE font Size using command?
- How to change the font size of textView in android?
- Change the font size of a button with CSS
- How to change the text color of font in the legend using Matplotlib?
- How to change font size in HTML?
- How to change font size in ttk.Button?
- How to set the font size of a Tkinter Canvas text item?
- How to change text font in HTML?
- How to change the font size of scientific notation in Matplotlib?
- How to create a small font text using JavaScript?
- How to create a big font text using JavaScript?
Advertisements