当前位置: 首页 > 网络学院 > 客户端脚本教程 > HTML DOM > HTML DOM images 集合
The images collection returns a reference to all Image objects in the document.
images集合可以返回所有在文档中图片对象的参考
document.images[] |
<html> <body>
<img border="0" src="hackanm.gif" width="48" height="48">
<br />
<img border="0" src="compman.gif" width="107" height="98">
<br /><br />
<script type="text/javascript">
document.write("This document contains: ")
document.write(document.images.length + " images.")
</script>
</body> </html> |
Count the number of images in a document
计算文档中有多少张图片
评论 (0) All