<!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>