当前位置: 移动技术网 > IT编程>开发语言>JavaScript > JavaSciprt中处理字符串之sup()方法的使用教程

JavaSciprt中处理字符串之sup()方法的使用教程

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

 这种方法会导致字符串显示为上标,就好像它是在一个<sup>标记。
语法

string.sup( )


下面是参数的详细信息:

  •     na

返回值:

  •     返回字符串带有<sup>标记

例子:

<html>
<head>
<title>javascript string sup() method</title>
</head>
<body>
<script type="text/javascript">

var str = new string("hello world");
alert(str.sup());

</script>
</body>
</html>


这将产生以下结果:

<sup>hello world</sup>

 

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

相关文章:

验证码:
移动技术网