简介JavaScript中fixed()方法的使用

2022-10-17,,,

 此方法会导致就好像它是在一个<tt>的标签被显示在固定间距的字体的字符串。
语法

string.fixed( )

下面是参数的详细信息:

  •     na

返回值:

  •     返回字符串的<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>

《简介JavaScript中fixed()方法的使用.doc》

下载本文的Word格式文档,以方便收藏与打印。