JavaScript 字符串 - fontsize() 方法
描述
此方法使字符串以指定的大小显示,就像在 <font size = "size"> 标签中一样。
语法
其语法如下:-
string.fontsize( size )
属性详情
size - 1 到 7 之间的整数,表示 1 到 7 之间的有符号整数的字符串。
返回值
返回带有 <font size="size"> 标签的字符串。
示例
尝试以下示例。
<html>
<head>
<title>JavaScript String fontsize() Method</title>
</head>
<body>
<script type = "text/javascript">
var str = new String("Hello world");
alert(str.fontsize( 3 ));
</script>
</body>
</html>
输出
<font size = "3">Hello world</font>
javascript_strings_object.html

