JavaScript String fixed()方法
描述
这个方法会使字符串以固定间距字体显示,就像在<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>
极客教程