此方法會導致就好像它是在一個<font size="size">標記的字串顯示在規定的大小
語法
string.fontsize( size )
下麵是參數的詳細資訊:
-
color: 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>
