JavaScript > Methods

Small style in JavaScript

How to apply small style to the text in JavaScript?


In case we want to apply the small font style to the text in the html page, we can use this approach.

<script>
        document.write("This is Small text ");
        document.write(" This is Small text".small());
</script>

In the above code snippet, we have written “This is Small text” in both document.write lines but in the 2nd statement we have called the small() method using the text that makes this text in small style as you can see in the below picture.

OUTPUT

 Views: 1171 | Post Order: 44



Write for us