From 40edc745dfb5c152e12080748f9357b376e8dbe9 Mon Sep 17 00:00:00 2001 From: MDN Date: Tue, 18 May 2021 00:44:37 +0000 Subject: [CRON] sync translated content --- files/pt-br/orphaned/web/api/parentnode/index.html | 164 +++++++++++++++++++++ .../web/api/parentnode/queryselector/index.html | 102 +++++++++++++ 2 files changed, 266 insertions(+) create mode 100644 files/pt-br/orphaned/web/api/parentnode/index.html create mode 100644 files/pt-br/orphaned/web/api/parentnode/queryselector/index.html (limited to 'files/pt-br/orphaned') diff --git a/files/pt-br/orphaned/web/api/parentnode/index.html b/files/pt-br/orphaned/web/api/parentnode/index.html new file mode 100644 index 0000000000..fd327f7adf --- /dev/null +++ b/files/pt-br/orphaned/web/api/parentnode/index.html @@ -0,0 +1,164 @@ +--- +title: ParentNode +slug: orphaned/Web/API/ParentNode +tags: + - API + - DOM + - NeedsTranslation + - TopicStub +translation_of: Web/API/ParentNode +original_slug: Web/API/ParentNode +--- +
{{APIRef("DOM")}}
+ +

The ParentNode interface contains methods that are particular to {{domxref("Node")}} objects that can have children.

+ +

ParentNode is a raw interface and no object of this type can be created; it is implemented by {{domxref("Element")}}, {{domxref("Document")}}, and {{domxref("DocumentFragment")}} objects.

+ +

Properties

+ +
+
{{ domxref("ParentNode.children") }} {{experimental_inline}} {{readonlyInline}}
+
Returns a live {{domxref("HTMLCollection")}} containing all objects of type {{domxref("Element")}} that are children of this ParentNode.
+
{{ domxref("ParentNode.firstElementChild") }} {{experimental_inline}} {{readonlyInline}}
+
Returns the {{domxref("Element")}} that is the first child of this ParentNode, or null if there is none.
+
{{ domxref("ParentNode.lastElementChild") }} {{experimental_inline}} {{readonlyInline}}
+
Returns the {{domxref("Element")}} that is the last child of this ParentNode, or null if there is none.
+
{{ domxref("ParentNode.childElementCount") }} {{experimental_inline}} {{readonlyInline}}
+
Returns an unsigned long giving the amount of children that the object has.
+
+ +

Methods

+ +
+
{{ domxref("ParentNode.append()") }} {{experimental_inline}}
+
Inserts a set of {{domxref("Node")}} objects or {{domxref("DOMString")}} objects after the last child of the ParentNode. {{domxref("DOMString")}} objects are inserted as equivalent {{domxref("Text")}} nodes.
+
{{ domxref("ParentNode.prepend()") }} {{experimental_inline}}
+
Inserts a set of {{domxref("Node")}} objects or {{domxref("DOMString")}} objects before the first child of the ParentNode. {{domxref("DOMString")}} objects are inserted as equivalent {{domxref("Text")}} nodes.
+
+ +

Specification

+ + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('DOM WHATWG', '#dom-parentnode-firstelementchild', 'ParentNode.firstElementChild')}}{{Spec2('DOM WHATWG')}}Splitted the ElementTraversal interface in {{domxref("ChildNode")}} and ParentNode. The firstElementChild, lastElementChild, and childElementCount properties are now defined on the latter.
+ The {{domxref("Document")}} and {{domxref("DocumentFragment")}} implemented the new interfaces.
+ Added the children property.
+ Added the append() and prepend() methods.
{{SpecName('Element Traversal', '#interface-elementTraversal', 'ElementTraversal')}}{{Spec2('Element Traversal')}}Added the initial definition of its properties to the ElementTraversal pure interface and use it on {{domxref("Element")}}.
+ +

Browser compatibility

+ +

{{CompatibilityTable}}

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support (on {{domxref("Element")}}){{CompatChrome(1.0)}}{{CompatGeckoDesktop("1.9.1")}}9.0 [1]10.04.0
Support on {{domxref("Document")}} and {{domxref("DocumentFragment")}} {{experimental_inline}}{{CompatChrome(29.0)}}{{CompatGeckoDesktop(25)}}{{CompatNo}}16.0{{CompatNo}}
append() and prepend() {{experimental_inline}}{{CompatChrome(54.0)}}{{CompatGeckoDesktop(49)}}{{CompatVersionUnknown}}{{CompatOpera(39)}}{{CompatNo}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidAndroid WebviewFirefox Mobile (Gecko)IE MobileOpera MobileSafari MobileChrome for Mobile
Basic support (on {{domxref("Element")}}){{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatGeckoMobile("1.9.1")}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
Support on {{domxref("Document")}} and {{domxref("DocumentFragment")}} {{experimental_inline}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatGeckoMobile(25)}}{{CompatNo}}16.0{{CompatNo}}{{CompatVersionUnknown}}
append() and prepend() {{experimental_inline}}{{CompatNo}}{{CompatChrome(54.0)}}{{CompatGeckoMobile(49)}}{{CompatNo}}{{CompatOperaMobile(39)}}{{CompatNo}}{{CompatChrome(54.0)}}
+
+ +

[1] Internet Explorer 6, 7 and 8 supported it, but erroneously returns {{domxref("Comment")}} nodes as part of the results.

+ +

See also

+ + diff --git a/files/pt-br/orphaned/web/api/parentnode/queryselector/index.html b/files/pt-br/orphaned/web/api/parentnode/queryselector/index.html new file mode 100644 index 0000000000..f554a19495 --- /dev/null +++ b/files/pt-br/orphaned/web/api/parentnode/queryselector/index.html @@ -0,0 +1,102 @@ +--- +title: ParentNode.querySelector() +slug: orphaned/Web/API/ParentNode/querySelector +tags: + - PrecisaDeExemplo + - Projeto + - Referencia + - Seletores + - metodo +translation_of: Web/API/ParentNode/querySelector +original_slug: Web/API/ParentNode/querySelector +--- +

{{APIRef("DOM")}}{{Draft}}

+ +

O {{DOMxRef("ParentNode")}} mixin define o querySelector() método como retornar um {{DOMxRef("Element")}} representando o primeiro elemento que corresponde ao grupo especificado de seletores que são descendentes do objeto no qual o método foi chamado.

+ +

Se você precisar de todos os elementos correspondentes à lista de seletores, use{{DOMxRef("ParentNode.querySelectorAll", "querySelectorAll()")}} instead.

+ +
+

Nota: Este método é implementado como {{DOMxRef("Document.querySelector()")}}, {{DOMxRef("DocumentFragment.querySelector()")}} e {{DOMxRef("Element.querySelector()")}}.

+
+ +

Sintaxe

+ +
element = parentNode.querySelector(selectors);
+
+ +

Parâmetros

+ +
+
selectors
+
Um {{DOMxRef("DOMString")}} contendo um ou mais seletores para comparar. Essa sequência deve ser um válido lista de seletores compostos suportado pelo navegador; se não for, um SyntaxError exceção é lançada. Veja Localizando elementos DOM usando seletores para obter mais informações sobre o uso de seletores para identificar elementos. Vários seletores podem ser especificados, separando-os usando vírgulas.
+
+ +
+

Nota: Os caracteres que não fazem parte da sintaxe CSS padrão devem ser escapados usando um caractere de barra invertida. Como o JavaScript também usa escape de backspace, deve-se tomar cuidado especial ao escrever literais de string usando esses caracteres. Veja {{anch("Escaping special characters")}} Para maiores informações.

+
+ +

Valor de retorno

+ +

O primeiro {{DOMxRef("Element")}} que corresponda a pelo menos um dos seletores ou null se esse elemento não for encontrado.

+ +
+

Nota: Se o especificado selectors inclua um CSS pseudo-elemento, o valor retornado é sempre null.

+
+ +

Exceções

+ +
+
SyntaxError
+
A sintaxe do especificado selectors string não é válida.
+
+ +

Especificações

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
EspecificaçãoStatusComentário
{{SpecName("DOM WHATWG", "#dom-parentnode-queryselector", "ParentNode.querySelector()")}}{{Spec2("DOM WHATWG")}}Padrão de vida
{{SpecName("Selectors API Level 2", "#dom-parentnode-queryselector", "ParentNode.querySelector()")}}{{Spec2("Selectors API Level 2")}}Sem alteração
{{SpecName("DOM4", "#dom-parentnode-queryselector", "ParentNode.querySelector()")}}{{Spec2("DOM4")}}Definição inicial
{{SpecName("Selectors API Level 1", "#interface-definitions", "document.querySelector()")}}{{Spec2("Selectors API Level 1")}}Definição original
+ +

Compatibilidade do navegador

+ + + +

{{Compat("api.ParentNode.querySelector")}}

+ +

Veja também

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