aboutsummaryrefslogtreecommitdiff
path: root/files/pt-br/web/api/document/images/index.html
blob: f5021122a9c34d2e6061b3c16ba6d0cb04f6400c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
---
title: Document.images
slug: Web/API/Document/images
translation_of: Web/API/Document/images
---
<div>
<div>{{ ApiRef("DOM") }}</div>
</div>

<h2 id="Summary" name="Summary">Summary</h2>

<p><code>document.images</code> retorna uma coleção de <a href="/en-US/docs/DOM/Image" title="DOM/Image">imagens</a> do documento HTML.</p>

<h2 id="Syntax" name="Syntax">Sintaxe</h2>

<pre class="syntaxbox"><em>var htmlCollection</em> = document.images;</pre>

<h2 id="Example" name="Example">Exemplo</h2>

<pre class="brush:js">var ilist = document.images;

for(var i = 0; i &lt; ilist.length; i++) {
    if(ilist[i].src == "banner.gif") {
        // found the banner
    }
}</pre>

<h2 id="Notes" name="Notes">Notas</h2>

<p><code>document.images.length</code> – propriedade, retorna o número de imagens na página.</p>

<p><code>document.images</code> é parte do DOM HTML, e só trabalho com documentos HTML.</p>

<h2 id="Specification" name="Specification">Especificação</h2>

<ul>
 <li><a class="external" href="http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-90379117">DOM Level 2 HTML: HTMLDocument.images</a></li>
</ul>