当前位置: 移动技术网 > IT编程>开发语言>JavaScript > 简介JavaScript中fixed()方法的使用

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

2019年08月03日  | 移动技术网IT编程  | 我要评论

 此方法会导致就好像它是在一个<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>

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网