W3cubDocs

/Dart 2

querySelector method

Element querySelector (String selectors)

Finds the first descendant element of this document fragment that matches the specified group of selectors.

selectors should be a string using CSS selector syntax.

var element1 = fragment.querySelector('.className');
var element2 = fragment.querySelector('#id');

For details about CSS selector syntax, see the CSS selector specification.

Implementation

Element querySelector(String selectors) native;

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dartlang.org/stable/2.0.0/dart-html/DocumentFragment/querySelector.html