HTMLの <sup> タグで囲まれた文字列を返します.
stringObject.sup()
以下にsupメソッドを使用して <sup> タグを作成するサンプルコードを示します.
<html>
<head>
<title>supメソッドのサンプルコード</title>
</head>
<body>
<script type="text/javascript" language="javascript">
var str = "Snoopy";
document.write("<p>normal: " + str + "</p>");
document.write("<p>sup: " + str.sup() + "</p>");
</script>
</body>
</html>
サンプルコードの実行結果は以下のようになります.
スポンサード リンク