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

 这种方法会导致字符串显示为上标,就好像它是在一个<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>