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 ---------------------- .../web/api/htmlorforeignelement/focus/index.html | 63 ---------------- 2 files changed, 151 deletions(-) delete mode 100644 files/pt-br/web/api/htmlorforeignelement/blur/index.html delete mode 100644 files/pt-br/web/api/htmlorforeignelement/focus/index.html (limited to 'files/pt-br/web/api') diff --git a/files/pt-br/web/api/htmlorforeignelement/blur/index.html b/files/pt-br/web/api/htmlorforeignelement/blur/index.html deleted file mode 100644 index cf416441d4..0000000000 --- a/files/pt-br/web/api/htmlorforeignelement/blur/index.html +++ /dev/null @@ -1,88 +0,0 @@ ---- -title: HTMLElement.blur() -slug: Web/API/HTMLOrForeignElement/blur -tags: - - API - - DOM HTML - - Foco - - HTMLElement - - Referencia - - metodo -translation_of: Web/API/HTMLOrForeignElement/blur -original_slug: Web/API/HTMLElement/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

- - diff --git a/files/pt-br/web/api/htmlorforeignelement/focus/index.html b/files/pt-br/web/api/htmlorforeignelement/focus/index.html deleted file mode 100644 index 4649b935b9..0000000000 --- a/files/pt-br/web/api/htmlorforeignelement/focus/index.html +++ /dev/null @@ -1,63 +0,0 @@ ---- -title: HTMLElement.focus() -slug: Web/API/HTMLOrForeignElement/focus -translation_of: Web/API/HTMLOrForeignElement/focus -original_slug: Web/API/HTMLElement/focus ---- -
{{ APIRef("HTML DOM") }}
- -

O método HTMLElement.focus()  seta o foco em um determinado elemento em especifico, caso esse elemento permita ter o foco neste elemento.

- -

Síntaxe

- -
element.focus()
- -

Especificação

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
EspecificaçãoStatusComentário
{{SpecName('HTML WHATWG', 'editing.html#dom-focus', 'focus')}}{{Spec2('HTML WHATWG')}} 
{{SpecName('HTML5.1', 'editing.html#focus()-0', 'focus')}}{{Spec2('HTML5.1')}} 
{{SpecName('HTML5 W3C', 'editing.html#dom-focus', 'focus')}}{{Spec2('HTML5 W3C')}} 
{{SpecName('DOM2 HTML', 'html.html#ID-32130014', 'focus')}}{{Spec2('DOM2 HTML')}} 
{{SpecName('DOM1', 'level-one-html.html#method-focus', 'focus')}}{{Spec2('DOM1')}} 
- -

Notas

- -

Caso você utilize o HTMLElement.focus() por meio da manipulação de um evento mousedown , você deve utilizar o evento event.preventDefault() a fim de o foco não sair do arquivo HTMLElement.

- -

Veja também

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