中文字幕一区二区人妻电影,亚洲av无码一区二区乱子伦as ,亚洲精品无码永久在线观看,亚洲成aⅴ人片久青草影院按摩,亚洲黑人巨大videos

HTML DOM images 集合

Document 對(duì)象參考手冊(cè) Document 對(duì)象

定義和用法

images 集合返回當(dāng)前文檔中所有圖片的數(shù)組。

語(yǔ)法

document.images[].property

瀏覽器支持

Internet ExplorerFirefoxOperaGoogle ChromeSafari

所有主要瀏覽器都支持 images 集合


實(shí)例

實(shí)例 1

返回文檔的圖片數(shù):

<html>
<body>

<img border="0" src="klematis.jpg" width="150" height="113">
<img border="0" src="klematis2.jpg" width="152" height="128">

<p>圖像數(shù)目:
<script>
document.write(document.images.length);
</script></p>

</body>
</html>

以上實(shí)例輸出結(jié)果:

圖像數(shù)目: 2

運(yùn)行代碼 ?

實(shí)例 2

返回文檔中的第一張圖片:

<html>
<body>

<img id="json1" border="0" src="klematis.jpg" width="150" height="113">
<img id="json2" border="0" src="klematis2.jpg" width="152" height="128">

<p>第一個(gè)圖像的ID:
<script>
document.write(document.images[0].id);
</script></p>

</body>
</html>

以上實(shí)例輸出結(jié)果:

第一個(gè)圖像的ID:json1

運(yùn)行代碼 ?

Document 對(duì)象參考手冊(cè) Document 對(duì)象其他擴(kuò)展