Appearance
dart:html ​
HTML elements and other resources for web-based applications that need to interact with the browser and the DOM (Document Object Model).
INFO
This core library is deprecated, and scheduled for removal in late 2025. It has been replaced by package:web. The migration guide has more details.
This library includes DOM element types, CSS styling, local storage, media, speech, events, and more. To get started, check out the Element class, the base class for many of the HTML DOM types.
For information on writing web apps with Dart, see https://dart.dev/web.
Classes ​
Exceptions ​
| Exception | Description |
|---|---|
| NullWindowException |
Functions ​
| Function | Description |
|---|---|
| promiseToFuture<T> | Converts a JavaScript Promise to a Dart Future. |
| promiseToFutureAsMap | Convert a JS Promise to a Future<Map<String, dynamic>>. |
| querySelector | Finds the first descendant element of this document that matches the specified group of selectors. |
| querySelectorAll<T extends Element> | Finds all descendant elements of this document that match the specified group of selectors. |
Properties ​
| Property | Description |
|---|---|
| document | Root node for all content in a web page. |
| window | Top-level container for a web page, which is usually a browser tab or window. |