手机
当前位置:查字典教程网 >编程开发 >Javascript教程 >html的DOM中document对象images集合用法实例
html的DOM中document对象images集合用法实例
摘要:本文实例讲述了html的DOM中document对象images集合用法。分享给大家供大家参考。具体分析如下: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程序设计有所帮助。

【html的DOM中document对象images集合用法实例】相关文章:

JQuery中DOM事件冒泡实例分析

Javascript递归打印Document层次关系实例分析

document 和 document.all 分别什么时候用

JavaScript操作Cookie方法实例分析

Javascript中With语句用法实例

微信浏览器内置JavaScript对象WeixinJSBridge使用实例

JavaScript的document和window对象详解

Javascript中For In语句用法实例

javascript原型模式用法实例详解

javascript委托(Delegate)blur和focus用法实例分析

精品推荐
分类导航