--- title: String.prototype.strike() slug: Web/JavaScript/Reference/Global_Objects/String/strike tags: - Deprecated - HTML wrapper methods - JavaScript - Method - Prototype - String translation_of: Web/JavaScript/Reference/Global_Objects/String/strike --- <div>{{JSRef}} {{deprecated_header}}</div> <p><strong><code>strike()</code></strong> メソッドは、文字列が取り消されたテキストとして表示されるように HTML の {{HTMLElement("strike")}} 要素を生成します。</p> <h2 id="Syntax" name="Syntax">構文</h2> <pre class="syntaxbox notranslate"><var>str</var>.strike()</pre> <h3 id="Return_value" name="Return_value">返値</h3> <p>HTML の {{HTMLElement("strike")}} 要素を含む文字列です。</p> <h2 id="Description" name="Description">解説</h2> <p><code>strike()</code> メソッドは、文字列を <code><strike></code> 要素の中に、 "<code><strike>str</strike></code>" のように埋め込みます。</p> <h2 id="Examples" name="Examples">例</h2> <h3 id="strike_の使用">strike() の使用</h3> <p>以下の例では文字列のメソッドを使用して、文字列の形式を変更しています。</p> <pre class="brush: js notranslate">var worldString = 'Hello, world'; console.log(worldString.blink()); // <blink>Hello, world</blink> console.log(worldString.bold()); // <b>Hello, world</b> console.log(worldString.italics()); // <i>Hello, world</i> console.log(worldString.strike()); // <strike>Hello, world</strike> </pre> <h2 id="Specifications" name="Specifications">仕様書</h2> <table class="standard-table"> <thead> <tr> <th scope="col">仕様書</th> </tr> </thead> <tbody> <tr> <td>{{SpecName('ESDraft', '#sec-string.prototype.strike', 'String.prototype.strike')}}</td> </tr> </tbody> </table> <h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2> <div class="hidden">このページの互換性一覧表は構造化データから生成されています。データに協力していただけるのであれば、 <a class="external" href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> をチェックアウトしてプルリクエストを送信してください。</div> <p>{{Compat("javascript.builtins.String.strike")}}</p> <h2 id="See_also" name="See_also">関連情報</h2> <ul> <li>{{jsxref("String.prototype.blink()")}}</li> <li>{{jsxref("String.prototype.bold()")}}</li> <li>{{jsxref("String.prototype.italics()")}}</li> </ul>