JavaScript fontsize () method
Definition and Usage
fontsize () method is used in accordance with the specified size to display the string.
This method returns a string plus <font> tag, as follows:
<Font size = "size"> string </ font>
grammar
string.fontsize(size)
参数 | 描述 |
---|---|
size | 必须. size 参数必须是从 1 至 7 的数字。 |
Browser Support
All major browsers support fontsize () methods.
Examples
Examples
Using the specified size to display the string:
<script>
var str = "Hello world!";
document.write(str.fontsize(7));
</script>
var str = "Hello world!";
document.write(str.fontsize(7));
</script>
try it"
JavaScript String Object