String small() Method - Javascript String

Javascript examples for String:small


The small() method displays a string in a small font.

This method returns the string embedded in the <small> tag, like this:<small>string</small>



Return Value:

A string embedded in the <small> tag

The following code shows how to Display a string in a small font:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>

<button onclick="myFunction()">Test</button>

<p id="demo"></p>

function myFunction() {/*w w  w .ja v a 2s  .  co m*/
    var str = "Hello World!";
    var result = str.small();
    document.getElementById("demo").innerHTML = result;


Related Tutorials