Create Small Font Text Using JavaScript



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 <small> tag.

Example

You can try to run the following code to create a small font using JavaScript −

Live Demo

<html>
   <head>
      <title>JavaScript String small() Method</title>
   </head>

   <body>
      <script>
         var str = new String("Demo Text");
         document.write(str.small())
         alert(str.small());
      </script>
   </body>
</html>
Updated on: 2020-06-15T06:52:29+05:30

629 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements