sub() 方法用于把字符串显示为下标。
stringObject.sub()
在本例中,"Hello world!" 将被显示为下标:
<html><body><script type="text/javascript">var str="Hello world!"document.write(str.sub())</script></body></html>
<html>
<body>
<script type="text/javascript">
var str="Hello world!"
document.write(str.sub())
</script>
</body>
</html>