Get to know MDN better
このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。
Since February 2026, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
メモ: この機能はウェブワーカー内で利用可能です。
emptyHTML は TrustedTypePolicyFactory インターフェイスの読み取り専用プロパティで、空文字列の入った TrustedHTML オブジェクトを返します。
このオブジェクトは、アプリケーションが注入先に空の文字列を挿入する必要がある場合に使用できます。
TrustedHTML オブジェクトです。
以下の例では、要素に空の文字列を挿入します。したがってポリシーを作成する必要はなく、emptyHTML プロパティを使用することで、信頼型オブジェクトが期待される場合に空の要素を挿入できます。
| Trusted Types # dom-trustedtypepolicyfactory-emptyhtml |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2025年10月13日 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.