--- title: Document.designMode slug: Web/API/Document/designMode tags: - API - DOM - Document - HTML DOM - Property - Reference - designmode - editor - エディター translation_of: Web/API/Document/designMode --- <div>{{ApiRef()}}</div> <p><strong><code>document.designMode</code></strong> は、文書全体を編集可能にするかどうかを制御します。妥当な値は <code>"on"</code> および <code>"off"</code> です。仕様書では、このプロパティの既定値は <code>"off"</code> です。 Firefox はこの標準仕様に従っています。初期のバージョンの Chrome や IE は既定で <code>"inherit"</code> です。 Chrome 43 以降では、既定値は <code>"off"</code> であり、 <code>"inherit"</code> には対応しなくなりました。 IE6~10 では、値が大文字です。</p> <h2 id="Syntax" name="Syntax">構文</h2> <pre class="syntaxbox">var mode = document.designMode; document.designMode = <em>value</em>;</pre> <h3 id="Value" name="Value">値</h3> <p><code>designMode</code> が on または off のどちらに設定されているか (または設定するか) を示す文字列です。有効な値は <code>on</code> および <code>off</code> です。</p> <h2 id="Example" name="Example">例</h2> <p>{{HTMLElement("iframe")}} の文書を編集可能にします。</p> <pre class="brush: js">iframeNode.contentDocument.designMode = "on"; </pre> <h2 id="Specifications" name="Specifications">仕様書</h2> <table class="standard-table"> <thead> <tr> <th scope="col">仕様書</th> <th scope="col">状態</th> <th scope="col">備考</th> </tr> </thead> <tbody> <tr> <td>{{SpecName('HTML WHATWG', '#making-entire-documents-editable:-the-designmode-idl-attribute', 'designMode')}}</td> <td>{{Spec2('HTML WHATWG')}}</td> <td>初回定義</td> </tr> </tbody> </table> <h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2> <p>{{Compat("api.Document.designMode")}}</p> <h2 id="See_also" name="See_also">関連情報</h2> <ul> <li><a href="/ja/docs/Rich-Text_Editing_in_Mozilla">Mozilla におけるリッチテキスト編集</a></li> <li>{{domxref("HTMLElement.contentEditable")}}</li> </ul>