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 July 2015.
Summary
document.images
retorna uma coleção de imagens do documento HTML.
Sintaxe
var htmlCollection = document.images;
Exemplo
js
var ilist = document.images;
for (var i = 0; i < ilist.length; i++) {
if (ilist[i].src == "banner.gif") {
// found the banner
}
}
Notas
document.images.length
– propriedade, retorna o número de imagens na página.
document.images
é parte do DOM HTML, e só trabalho com documentos HTML.
Especificações
Specification |
---|
HTML # dom-document-images-dev |
Compatibilidade com navegadores
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
images |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- Partial support
- Partial support
- Has more compatibility info.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.