HTMLDOMドキュメントの埋め込み
例
ドキュメント内の<embed>要素の数:
let num = document.embeds.length;
定義と使用法
このembeds
プロパティは、ドキュメント内のすべての<embed>要素のコレクションを返します。
embeds
プロパティは読み取り専用です。
警告
ほとんどのブラウザは、組み込みアプレットまたはプラグインをサポートしなくなりました。
埋め込みActiveXコントロールは、どのブラウザでもサポートされなくなりました。
Shockwave Flashは、最近のブラウザでもオフになっています。
提案
画像を埋め込むには、<img>
タグを使用します。
HTMLを埋め込むには、<iframe>
タグを使用します。
ビデオまたはオーディオを埋め込むには、<video>
または<audio>
タグを使用します。
関連項目:
構文
document.embeds
プロパティ
Property | Description |
length | The number of <embed> elements in the collection. |
メソッド
Method | Description |
[index] | Returns the element with the specified index (starts at 0). Returns null if the index is out of range. |
item(index) | Returns the element with the specified index (starts at 0). Returns null if the index is out of range. |
namedItem(id) | Returns the element with the specified id. Returns null if the id does not exist. |
戻り値
タイプ | 説明 |
ノードリスト | HTMLCollection。 ドキュメント内のすべての<embed>要素。 ソースコードに表示されるとおりに並べ替えられます。 |
ブラウザのサポート
document.embeds
DOMレベル3(2004)の機能です。
すべてのブラウザで完全にサポートされています。
Chrome | IE | Edge | Firefox | Safari | Opera |
Yes | 9-11 | Yes | Yes | Yes | Yes |