此方法使字符串以固定间距字体显示,就好像它在<tt>标签中一样。
string.fixed( )
返回带有<tt>标签的字符串。
<html> <head> <title>JavaScript String fixed() Method</title> </head> <body> <script type="text/javascript"> var str=new String("Hello world"); alert(str.fixed()); </script> </body> </html>
运行上面代码输出
<tt>Hello world</tt>
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)