blob: c560161be4a15b1a26627ee8025d8390eda23e1b (
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
|
---
title: HTMLInputElement.select()
slug: Web/API/HTMLInputElement/select
tags:
- API
- HTML DOM
- HTMLInputElement
- Referencia
- Selecionar
- Select
- metodo
translation_of: Web/API/HTMLInputElement/select
---
<div>{{ APIRef("HTML DOM") }}</div>
<p>O método <strong><code>HTMLInputElement.select()</code></strong> seleciona todo o texto em um elemento {{HTMLElement("textarea")}} ou em um elemento {{HTMLElement("input")}} do tipo <em>text</em>.</p>
<h2 id="Syntax" name="Syntax">Sintaxe</h2>
<pre class="syntaxbox">element.select()</pre>
<h2 id="Specification" name="Specification">Especificação</h2>
<table class="standard-table">
<thead>
<tr>
<th scope="col">Especificação</th>
<th scope="col">Estado</th>
<th scope="col">Comentário</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{SpecName('HTML WHATWG', 'forms.html#dom-textarea/input-select', 'select')}}</td>
<td>{{Spec2('HTML WHATWG')}}</td>
<td> </td>
</tr>
</tbody>
</table>
<h2 id="Notas">Notas</h2>
<p>Executar <code>element.select()</code> não irá necessariamente focar o <em>input</em>, por isso é frequentemente usado em conjunto com {{domxref("HTMLElement.focus()")}}.</p>
<h2 id="Veja_também">Veja também</h2>
<ul>
<li>{{ HTMLElement("input") }}</li>
<li>{{ HTMLElement("textarea") }}</li>
<li>{{ domxref("HTMLInputElement") }}</li>
<li>{{ domxref("HTMLInputElement.setSelectionRange") }}</li>
</ul>
|