aboutsummaryrefslogtreecommitdiff
path: root/files/pt-br/orphaned/web/api/htmlorforeignelement/focus
diff options
context:
space:
mode:
authorMDN <actions@users.noreply.github.com>2021-07-08 00:34:19 +0000
committerMDN <actions@users.noreply.github.com>2021-07-08 00:34:19 +0000
commitff9ea0cf9f0ea6217deefa7ad0dba35bf7f6c45e (patch)
treed11054dc18b78736aa981b3102bfd731f86bcd43 /files/pt-br/orphaned/web/api/htmlorforeignelement/focus
parent874d81c43e8e5d7d498b452a8d82bd6879aa5716 (diff)
downloadtranslated-content-ff9ea0cf9f0ea6217deefa7ad0dba35bf7f6c45e.tar.gz
translated-content-ff9ea0cf9f0ea6217deefa7ad0dba35bf7f6c45e.tar.bz2
translated-content-ff9ea0cf9f0ea6217deefa7ad0dba35bf7f6c45e.zip
[CRON] sync translated content
Diffstat (limited to 'files/pt-br/orphaned/web/api/htmlorforeignelement/focus')
-rw-r--r--files/pt-br/orphaned/web/api/htmlorforeignelement/focus/index.html63
1 files changed, 63 insertions, 0 deletions
diff --git a/files/pt-br/orphaned/web/api/htmlorforeignelement/focus/index.html b/files/pt-br/orphaned/web/api/htmlorforeignelement/focus/index.html
new file mode 100644
index 0000000000..d2da909bc6
--- /dev/null
+++ b/files/pt-br/orphaned/web/api/htmlorforeignelement/focus/index.html
@@ -0,0 +1,63 @@
+---
+title: HTMLElement.focus()
+slug: orphaned/Web/API/HTMLOrForeignElement/focus
+translation_of: Web/API/HTMLOrForeignElement/focus
+original_slug: Web/API/HTMLOrForeignElement/focus
+---
+<div>{{ APIRef("HTML DOM") }}</div>
+
+<p>O método <strong><code>HTMLElement.focus()</code></strong>  seta o foco em um determinado elemento em especifico, caso esse elemento permita ter o foco neste elemento.</p>
+
+<h2 id="Syntax" name="Syntax">Síntaxe</h2>
+
+<pre class="syntaxbox">element.focus()</pre>
+
+<h2 id="Specification" name="Specification">Especificação</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">Especificação</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comentário</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName('HTML WHATWG', 'editing.html#dom-focus', 'focus')}}</td>
+ <td>{{Spec2('HTML WHATWG')}}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('HTML5.1', 'editing.html#focus()-0', 'focus')}}</td>
+ <td>{{Spec2('HTML5.1')}}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('HTML5 W3C', 'editing.html#dom-focus', 'focus')}}</td>
+ <td>{{Spec2('HTML5 W3C')}}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('DOM2 HTML', 'html.html#ID-32130014', 'focus')}}</td>
+ <td>{{Spec2('DOM2 HTML')}}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('DOM1', 'level-one-html.html#method-focus', 'focus')}}</td>
+ <td>{{Spec2('DOM1')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Notas">Notas</h2>
+
+<p>Caso você utilize o <code>HTMLElement.focus()</code> por meio da manipulação de um evento mousedown , você deve utilizar o evento <code>event.preventDefault()</code> a fim de o foco não sair do arquivo <code>HTMLElement</code>.</p>
+
+<h2 id="Veja_também">Veja também</h2>
+
+<ul>
+ <li>Método DOM {{domxref("HTMLElement.blur()")}} para remover o foco de um determinado elemento.</li>
+ <li>{{ domxref("document.activeElement") }} para saber qual elemento do html que está com o foco. </li>
+</ul>