String small() Method - Javascript String

Javascript examples for String:small

Description

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>

Parameters

None.

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>
<html>
<body>

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

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

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

</body>
</html>

Related Tutorials