您的浏览器过于古老 & 陈旧。为了更好的访问体验, 请 升级你的浏览器
Ready 发布于2014年08月11日 10:04

原创 JavaScript String.fixed() 函数详解

2128 次浏览 读完需要≈ 2 分钟

内容目录

fixed()函数返回包含指定字符串文本的<tt>标签字符串。

该函数属于String对象,所有主流浏览器均支持该函数

语法

stringObject.fixed( )

返回值

fixed()方法的返回值为String类型,其返回值形如:

<tt> stringObject</tt>

示例&说明

var str = "Google搜索引擎";
document.writeln( str.fixed() ); // <tt>Google搜索引擎</tt>

str = "腾讯QQ";
document.writeln( str.fixed() ); // <tt>腾讯QQ</tt>

运行代码

  • CodePlayer技术交流群1
  • CodePlayer技术交流群2

0 条评论

撰写评论

打开导航菜单