aboutsummaryrefslogtreecommitdiff
path: root/files/pt-br/web/html/element/datalist/index.html
blob: 0ae859d16467295d72118723ba8ab3cdbc96444c (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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
---
title: datalist
slug: Web/HTML/Element/datalist
translation_of: Web/HTML/Element/datalist
---
<h2 id="Sumário">Sumário</h2>

<p>O elemento HTML <em>Datalist</em> (<span style="font-family: Courier New;">&lt;datalist&gt;</span>) contém um conjunto de elementos {{ HTMLElement("option") }} que representam as opções possíveis para o valor de outros controles.</p>

<h2 id="Contexto_de_uso">Contexto de uso</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <td>Conteúdo permitido</td>
   <td><a href="/en/HTML/Content_categories#phrasing_content" title="en/HTML/Content categories#phrasing content">Phrasing content</a> ou qualquer quantidade de elementos {{ HTMLElement("option") }} (ou nenhum)</td>
  </tr>
  <tr>
   <td>Omissão de tags</td>
   <td>Nenhuma, ambas as tags inicial e final são obrigatórias</td>
  </tr>
  <tr>
   <td>Elementos pais permitidos</td>
   <td>Qualquer elemento que aceite <a href="/en/HTML/Content_categories#phrasing_content" title="en/HTML/Content categories#phrasing content">phrasing content</a></td>
  </tr>
  <tr>
   <td>Documento normativo</td>
   <td><a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-button-element.html#the-datalist-element" rel="external nofollow" title="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-button-element.html#the-datalist-element">HTML5, section 4.10.10</a></td>
  </tr>
 </tbody>
</table>

<h2 id="Atributos">Atributos</h2>

<p>Esse elemento não tem nenhum atributo a não ser os <a href="/en/HTML/Global_attributes" title="en/HTML/Global attributes">global attributes</a>, comuns para todos os elementos.</p>

<h2 class="editable" id="Interface_do_DOM">Interface do DOM</h2>

<p>Esse elemento implementa a interface <code><a href="/en/DOM/HTMLDataListElement" title="en/DOM/HTMLDataListElement">HTMLDataListElement</a></code>.</p>

<h2 id="Exemplos">Exemplos</h2>

<pre class="brush: html notranslate">&lt;input list="browsers" /&gt;
&lt;datalist id="browsers"&gt;
  &lt;option value="Chrome"&gt;
  &lt;option value="Firefox"&gt;
  &lt;option value="Internet Explorer"&gt;
  &lt;option value="Opera"&gt;
  &lt;option value="Safari"&gt;
&lt;/datalist&gt;
</pre>

<p><a href="/samples/html/datalist.html">View Live Examples</a></p>

<p>Esse código HTML é renderizado assim no Firefox 4:</p>

<p><img alt="datalist.png" class="default internal" src="/@api/deki/files/4982/=datalist.png"></p>

<h2 id="Compatibilidade">Compatibilidade</h2>

<p>{{ CompatibilityTable() }}</p>

<div id="compat-desktop">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Recurso</th>
   <th>Chrome</th>
   <th>Firefox (Gecko)</th>
   <th>Internet Explorer</th>
   <th>Opera</th>
   <th>Safari</th>
  </tr>
  <tr>
   <td>Suporte básico</td>
   <td>20</td>
   <td>{{ CompatGeckoDesktop("2.0") }}</td>
   <td>10</td>
   <td>9.5</td>
   <td>{{ CompatNo() }}</td>
  </tr>
 </tbody>
</table>
</div>

<div id="compat-mobile">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Recurso</th>
   <th>Android</th>
   <th>Firefox Mobile (Gecko)</th>
   <th>IE Mobile</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
  </tr>
  <tr>
   <td>Suporte básico</td>
   <td>{{ CompatUnknown() }}</td>
   <td>{{ CompatGeckoMobile("2.0") }}</td>
   <td>{{ CompatUnknown() }}</td>
   <td>10</td>
   <td>{{ CompatUnknown() }}</td>
  </tr>
 </tbody>
</table>
</div>

<h2 id="Polyfill">Polyfill</h2>

<p>Inclua este polyfill para fornecer suporte para navegadores mais antigos e atualmente incompatíveis:<br>
 <a href="https://github.com/mfranzke/datalist-polyfill">datalist-polyfill</a></p>

<h2 id="Veja_também">Veja também</h2>

<ul>
 <li class="last">O elemento {{ HTMLElement("input") }}, especialmente seu atributo {{ htmlattrxref("list", "input") }};</li>
 <li class="last">O elemento {{ HTMLElement("option") }}.</li>
</ul>

<div>{{ languages({ "zh-cn": "zh-cn/HTML/Element/datalist", "ja": "ja/HTML/Element/datalist" }) }}</div>