This page was translated from English by the community. Learn more and join the MDN Web Docs community.
Document.images
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2018년 6월.
document.images 는 현재 HTML document 내부의 images collection을 반환합니다.
Syntax
js
var htmlCollection = document.images;
Example
js
var ilist = document.images;
for (var i = 0; i < ilist.length; i++) {
if (ilist[i].src == "banner.gif") {
// found the banner
}
}
Notes
document.images.length – 페이지의 이미지 갯수를 반환하는 속성
document.images 는 DOM HTML의 part이며, HTML documents 에서만 지원된다.
명세서
| Specification |
|---|
| HTML> # dom-document-images-dev> |