From 2e4c6c5892cd21091393887b1895162f85023fc8 Mon Sep 17 00:00:00 2001 From: Masahiro Fujimoto Date: Fri, 4 Feb 2022 16:47:14 +0900 Subject: Element.querySelector 系の記事を移行 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- files/ja/web/api/element/queryselector/index.html | 91 ----------------------- 1 file changed, 91 deletions(-) delete mode 100644 files/ja/web/api/element/queryselector/index.html (limited to 'files/ja/web/api/element/queryselector/index.html') diff --git a/files/ja/web/api/element/queryselector/index.html b/files/ja/web/api/element/queryselector/index.html deleted file mode 100644 index 1aec9dde2d..0000000000 --- a/files/ja/web/api/element/queryselector/index.html +++ /dev/null @@ -1,91 +0,0 @@ ---- -title: Element.querySelector() -slug: Web/API/Element/querySelector -translation_of: Web/API/Element/querySelector ---- -
{{APIRef}}
- -

対象要素の子孫の内、引数に指定したCSSセレクタにマッチする最初の要素を返します。

- -

構文

- -
element = baseElement.querySelector(selectors);
-
- - - -

- -

次の例では、type属性を持たないか、text/csstype属性として持つ、ドキュメントボディーの中で最初のstyle要素が返却されます。

- -
var el = document.body.querySelector("style[type='text/css'], style:not([type])");
-
- -

注記

- -

マッチする要素が無い場合はnullを返します。その他の場合は、最初にマッチした要素を返します。

- -

指定されたセレクタが不正である場合、例外「SYNTAX_ERR」がスローされます。

- -

Throws a SYNTAX_ERR exception if the specified group of selectors is invalid.

- -

querySelector()はWebApps API仕様で定義されました。

- -

querySelectorに渡す文字列はCSSの文法に則る必要があります。{{domxref("document.querySelector")}}で実例を見て下さい。

- -

ブラウザ実装状況

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
BrowserSupportNotes
Internet Explorer8CSS 2.1 selectors only (IE8)
Firefox (Gecko)3.5 (1.9.1) 
Opera10 
Chrome1 
Safari (webkit)3.2 (525.3)webk.it/16587
- -

仕様書

- - - -

関連情報

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