HTML DOM images 集合
定義和用法
images 集合可返回對文檔中所有 Image 對象的引用。
語法
document.images[]
提示和注釋
注釋:為了與 0 級 DOM 兼容,該集合不包括由 <object> 標(biāo)記定義的圖像。
實例
<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>