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