<!DOCTYPE html> <html> <body> <h1>Document 对象</h1> <h2>images 属性</h2> <img src="/static/demo/images/tulip.jpg" alt="flower" width="180" height="180"> <img src="/static/demo/images/tulip-2.jpg" alt="flower" width="180" height="180"> <img src="/static/demo/images/flower.gif" alt="flower" width="180" height="180"> <p>图片数量为:</p> <p id="demo"></p> <script> let numb = document.images.length; document.getElementById("demo").innerHTML = numb; </script> </body> </html>