此方法使字符串显示为上标,就好像它在<sup>标签中一样。
string.sup( )
返回带有<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>
运行上面代码输出
链接:https://www.learnfk.comhttps://www.learnfk.com/javascript/string-sup.html
来源:LearnFk无涯教程网
<sup>Hello world</sup>
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)