时间:2021-07-01 10:21:17 帮助过:76人阅读
这种方法会导致字符串显示为下标,就好像它是在<sub>标记。
语法
string.sub( )
下面是参数的详细信息:
返回值:
例子:
<html>
<head>
<title>JavaScript String sub() Method</title>
</head>
<body>
<script type="text/javascript">
var str = new String("Hello world");
alert(str.sub());
</script>
</body>
</html>
这将产生以下结果:
<sub>Hello world</sub>