html的DOM中document对象images集合用法实例
本文向大家介绍html的DOM中document对象images集合用法实例,包括了html的DOM中document对象images集合用法实例的使用技巧和注意事项,需要的朋友参考一下
本文实例讲述了html的DOM中document对象images集合用法。分享给大家供大家参考。具体分析如下:
images 集合可返回对文档中所有 Image 对象的引用。
语法:
document.images[]
为了与 0 级 DOM 兼容,该集合不包括由 <object> 标记定义的图像。
例子:
<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>
希望本文所述对大家的javascript程序设计有所帮助。