JavaSciprt中处理字符串之sup()方法的使用教程
这种方法会导致字符串显示为上标,就好像它是在一个<sup>标记。
语法
string.sup()
下面是参数的详细信息:
- NA
返回值:
- 返回字符串带有<sup>标记
例子:
<html>
<head>
<title>JavaScriptStringsup()Method</title>
</head>
<body>
<scripttype="text/javascript">
varstr=newString("Helloworld");
alert(str.sup());
</script>
</body>
</html>
这将产生以下结果:
<sup>Helloworld</sup>