代码示例:(标识:jsck_doc_embeds)
<!DOCTYPE html>
<html>
<body>

<h1>Document 对象</h1>

<h2>embeds 属性</h2>

<p>本文档中 embed 元素的数量:</p>

<p id="demo"></p>

<embed type="image/jpg" src="/static/demo/images/tulip.jpg">
<embed type="image/jpg" src="/static/demo/images/tulip-2.jpg">

<script>
let num = document.embeds.length;
document.getElementById("demo").innerHTML = num;
</script>

</body>
</html>
运行结果: