此方法使字符串以指定的大小显示,就像在<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>
运行上面代码输出
链接:https://www.learnfk.comhttps://www.learnfk.com/javascript/string-fontsize.html
来源:LearnFk无涯教程网
<font size="3">Hello world</font>
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)