JavaScript 文字列操作 新しいページはコチラ
提供: yonewiki
(→斜体文字 italics) |
(→取り消し線 strike) |
||
316行: | 316行: | ||
=== 取り消し線 strike === | === 取り消し線 strike === | ||
+ | *strData11.strike() | ||
+ | |||
+ | |||
+ | 上記のように引数は設定できません。取り消し線が引かれます。文字のおおよそ中心あたりをとおるように線がひかれると思ってよいでしょう。どうしても、線の引かれる位置まで気にする場合は、別の方法を考えなければなりません。 | ||
+ | |||
+ | |||
+ | サンプルスクリプト | ||
+ | <syntaxhighlight lang="javascript" line start="1"> | ||
+ | strData11 = new String("文字の取り消し線(strike)"); | ||
+ | |||
+ | document.write(strData11.strike(), "</BR>"); | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | |||
+ | 表示結果: | ||
+ | |||
+ | <yjavascript> | ||
+ | strData11 = new String("文字の取り消し線(strike)"); | ||
+ | |||
+ | document.write(strData11.strike(), "</BR>"); | ||
+ | |||
+ | </yjavascript> | ||
+ | |||
=== 下付き文字 sub === | === 下付き文字 sub === | ||
=== 上付き文字 sup === | === 上付き文字 sup === |