From ff9ea0cf9f0ea6217deefa7ad0dba35bf7f6c45e Mon Sep 17 00:00:00 2001 From: MDN Date: Thu, 8 Jul 2021 00:34:19 +0000 Subject: [CRON] sync translated content --- .../web/api/htmlorforeignelement/blur/index.html | 88 ++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 files/pt-br/orphaned/web/api/htmlorforeignelement/blur/index.html (limited to 'files/pt-br/orphaned/web/api/htmlorforeignelement/blur') diff --git a/files/pt-br/orphaned/web/api/htmlorforeignelement/blur/index.html b/files/pt-br/orphaned/web/api/htmlorforeignelement/blur/index.html new file mode 100644 index 0000000000..2ce85ac57e --- /dev/null +++ b/files/pt-br/orphaned/web/api/htmlorforeignelement/blur/index.html @@ -0,0 +1,88 @@ +--- +title: HTMLElement.blur() +slug: orphaned/Web/API/HTMLOrForeignElement/blur +tags: + - API + - DOM HTML + - Foco + - HTMLElement + - Referencia + - metodo +translation_of: Web/API/HTMLOrForeignElement/blur +original_slug: Web/API/HTMLOrForeignElement/blur +--- +
{{ APIRef("HTML DOM") }}
+ +

O método HTMLElement.blur() remove o foco do teclado no elemento corrente.

+ +

Sintaxe

+ +
elemento.blur();
+ +

Exemplos

+ +

Removendo o foco de um input de texto

+ +

HTML

+ +
<input type="text" id="meuTexto" value="Texto Exemplo">
+<br><br>
+<button type="button" onclick="focusInput()">Clique para definir o foco</button>
+<button type="button" onclick="blurInput()">Clique para remover o foco</button>
+ +

JavaScript

+ +
function focusInput() {
+  document.getElementById('meuTexto').focus();
+}
+function blurInput() {
+  document.getElementById('meuTexto').blur();
+}
+ +

Resultado

+ +

{{ EmbedLiveSample('Remove_focus_from_a_text_input') }}

+ +

Especificação

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
EspecificaçãoStatusComentário
{{SpecName('HTML WHATWG', 'editing.html#dom-blur', 'blur')}}{{Spec2('HTML WHATWG')}} 
{{SpecName('HTML5.1', 'editing.html#blur()-0', 'blur')}}{{Spec2('HTML5.1')}} 
{{SpecName('HTML5 W3C', 'editing.html#dom-blur', 'blur')}}{{Spec2('HTML5 W3C')}} 
{{SpecName('DOM2 HTML', 'html.html#ID-28216144', 'blur')}}{{Spec2('DOM2 HTML')}} 
+ +

Compatibilidade com navegadores

+ +

{{Compat("api.HTMLElement.blur")}}

+ +

Veja também

+ + -- cgit v1.2.3-54-g00ecf