dart:html library

需要与浏览器和DOM(文档对象模型)进行交互的基于Web的应用程序的HTML元素和其他资源.

该库包括DOM元素类型,CSS样式,本地存储,媒体,语音,事件等. 首先,请查看Element类,它是许多HTML DOM类型的基类.

有关使用Dart编写Web应用程序的信息,请参见https://webdev.dartlang.org .

Classes

AbortPaymentEvent
AbsoluteOrientationSensor
AbstractWorker
Accelerometer
AccessibleNode
AccessibleNodeList
AmbientLightSensor
AnchorElement
Animation
AnimationEffectReadOnly
AnimationEffectTiming
AnimationEffectTimingReadOnly
AnimationEvent
AnimationPlaybackEvent
AnimationTimeline
AnimationWorkletGlobalScope
ApplicationCache
通过Window.applicationCache访问ApplicationCache.
ApplicationCacheErrorEvent
AreaElement
DOM区域元素,用于通过超链接链接图像地图的区域. [...]
AudioElement
AuthenticatorAssertionResponse
AuthenticatorAttestationResponse
AuthenticatorResponse
BackgroundFetchClickEvent
BackgroundFetchedEvent
BackgroundFetchEvent
BackgroundFetchFailEvent
BackgroundFetchFetch
BackgroundFetchManager
BackgroundFetchRegistration
BackgroundFetchSettledFetch
BarcodeDetector
BarProp
BaseElement
BatteryManager
BeforeInstallPromptEvent
BeforeUnloadEvent
Blob
BlobEvent
BluetoothRemoteGattDescriptor
Body
BodyElement
BRElement
BroadcastChannel
BudgetState
ButtonElement
ButtonInputElement
一个按钮,没有默认行为.
CacheStorage
CanMakePaymentEvent
CanvasCaptureMediaStreamTrack
CanvasElement
CanvasGradient
代表渐变的不透明画布对象. [...]
CanvasImageSource
可以绘制到2D画布渲染上下文的对象. [...]
CanvasPattern
代表图像,画布或视频图案的不透明对象. [...]
CanvasRenderingContext
CanvasRenderingContext2D
CDataSection
CharacterData
CheckboxInputElement
布尔编辑器控件. [...]
ChildNode
Client
Clients
ClipboardEvent
CloseEvent
Comment
CompositionEvent
Console
ContentElement
CookieStore
Coordinates
Credential
CredentialsContainer
CredentialUserData
Crypto
CryptoKey
Css
CssCharsetRule
CssClassSet
一个Set,用于存储元素的CSS类名称.
CssConditionRule
CssFontFaceRule
CssGroupingRule
CssImageValue
CssImportRule
CssKeyframeRule
CssKeyframesRule
CssKeywordValue
CssMatrixComponent
CssMediaRule
CssNamespaceRule
CssNumericValue
CssPageRule
CssPerspective
CssPositionValue
CssRect
表示CSS尺寸的类. [...]
CssResourceValue
CssRotation
CssRule
CssScale
CssSkew
CssStyleDeclaration
CssStyleDeclarationBase
CssStyleRule
CssStyleSheet
CssStyleValue
CssSupportsRule
CssTransformComponent
CssTransformValue
CssTranslation
CssUnitValue
CssUnparsedValue
CssurlImageValue
CssVariableReferenceValue
CssViewportRule
CustomElementRegistry
CustomEvent
CustomStream<T extends Event>
自定义事件流,使用户能够将自己的自定义事件"触发"(添加)到流中.
DataElement
DataListElement
DataTransfer
DataTransferItem
DataTransferItemList
DateInputElement
没有时区的日期(年,月,日). [...]
DedicatedWorkerGlobalScope
DeprecatedStorageInfo
DeprecatedStorageQuota
DeprecationReport
DetailsElement
DetectedBarcode
DetectedFace
DetectedText
DeviceAcceleration
DeviceMotionEvent
DeviceOrientationEvent
DeviceRotationRate
DialogElement
Dimension
表示CSS中长度测量的类.
DirectoryEntry
DirectoryReader
DivElement
HTML页面上的内容的通用容器; 对应于<div>标签. [...]
DListElement
Document
所有文档的基类. [...]
DocumentFragment
DocumentOrShadowRoot
DocumentTimeline
DomError
DomException
DomImplementation
DomIterator
DomMatrix
DomMatrixReadOnly
DomParser
DomPoint
DomPointReadOnly
DomQuad
DomRectList
DomRectReadOnly
DomStringList
DomStringMap
DomTokenList
Element
所有HTML元素都将扩展的抽象类.
ElementEvents
ElementList<T extends Element>
包含HTML元素的不可变列表. 与常规列表相比,此列表包含一些其他方法,以便于对一组元素进行CSS操作.
ElementStream<T extends Event>
可用于Element的专用Stream启用事件委托.
ElementUpgrader
A utility for changing the Dart wrapper type for elements.
EmailInputElement
电子邮件地址或电子邮件地址列表. [...]
EmbedElement
Entry
ErrorEvent
Event
Events
支持侦听和调度浏览器事件的基类. [...]
EventSource
EventStreamProvider<T extends Event>
将DOM事件公开为Streams的工厂.
EventTarget
支持事件的所有浏览器对象的基类. [...]
ExtendableEvent
ExtendableMessageEvent
External
FaceDetector
FederatedCredential
FetchEvent
FieldSetElement
File
FileEntry
FileList
FileReader
FileSystem
FileUploadInputElement
用于从用户计算机中选择文件的控件.
FileWriter
FixedSizeListIterator<T>
FocusEvent
FontFace
FontFaceSet
FontFaceSetLoadEvent
FontFaceSource
ForeignFetchEvent
FormData
FormElement
Gamepad
GamepadButton
GamepadEvent
GamepadPose
Geolocation
Geoposition
GlobalEventHandlers
Gyroscope
HashChangeEvent
HeadElement
Headers
HeadingElement
HiddenInputElement
隐藏的输入,用户不希望看到或编辑.
History
HistoryBase
HRElement
An <hr> tag.
HtmlCollection
HtmlDocument
HtmlElement
HtmlFormControlsCollection
HtmlHtmlElement
HtmlHyperlinkElementUtils
HtmlOptionsCollection
HttpRequest
客户端XHR请求,用于从URL中获取数据,正式称为XMLHttpRequest. [...]
HttpRequestEventTarget
HttpRequestUpload
HttpStatus
HTTP状态代码. 以dart:io和dart:html导出.
IdleDeadline
IFrameElement
ImageBitmap
ImageBitmapRenderingContext
ImageButtonInputElement
用户可以选择坐标的图像或表单提交按钮.
ImageCapture
ImageData
ImageElement
ImmutableListMixin<E>
InputDeviceCapabilities
InputElement
InputElementBase
公开所有InputElement类型之间共有的功能.
InstallEvent
IntersectionObserver
IntersectionObserverEntry
InterventionReport
KeyboardEvent
一个事件,描述用户与键盘的交互. [...]
KeyboardEventStream
记录发生在特定元素上的KeyboardEvent,并提供具有跨浏览器一致的keyCode和charCode值的传出KeyEvent流,尽管许多浏览器的键盘默认行为有所不同. [...]
KeyCode
定义KeyboardEvent.keyCode返回的键的键代码值. [...]
KeyEvent
一个自定义的KeyboardEvent,它试图消除跨浏览器的不一致,并且还为所有键事件提供keyCode和charCode信息(可以确定此类信息时). [...]
KeyframeEffect
KeyframeEffectReadOnly
KeyLocation
定义KeyboardEvent.getKeyLocation返回的标准键位置.
LabelElement
LegendElement
LIElement
LinearAccelerationSensor
LinkElement
LocalDateTimeInputElement
没有时区的日期和时间(年,月,日,小时,分钟,秒,几分之一秒). [...]
Location
LocationBase
Magnetometer
MapElement
MediaCapabilities
MediaCapabilitiesInfo
MediaDeviceInfo
MediaDevices
MediaElement
MediaEncryptedEvent
MediaError
MediaKeyMessageEvent
MediaKeys
MediaKeySession
MediaKeysPolicy
MediaKeyStatusMap
MediaKeySystemAccess
MediaList
MediaMetadata
MediaQueryList
MediaQueryListEvent
MediaRecorder
MediaSession
MediaSettingsRange
MediaSource
MediaStream
MediaStreamEvent
MediaStreamTrack
MediaStreamTrackEvent
MemoryInfo
HTML [...]
MessageChannel
MessageEvent
MessagePort
Metadata
MetaElement
MeterElement
MidiAccess
MidiConnectionEvent
MidiInput
MidiInputMap
MidiMessageEvent
MidiOutput
MidiOutputMap
MidiPort
MimeType
MimeTypeArray
ModElement
MonthInputElement
日期,由一年和一个月组成,没有时区. [...]
MouseEvent
MutationEvent
MutationObserver
MutationRecord
NetworkInformation
Node
NodeFilter
NodeIterator
NodeList
NodeTreeSanitizer
构造后执行节点树的清理,以确保它不包含任何不允许的元素或属性. [...]
NodeValidator
将HTML字符串解析为DOM节点时用于验证仅允许接受的元素和属性的接口. [...]
NodeValidatorBuilder
有助于构建标准节点验证策略的类. [...]
NoncedElement
NonDocumentTypeChildNode
NonElementParentNode
Notification
NotificationEvent
NumberInputElement
数字编辑器控件.
ObjectElement
OffscreenCanvas
OffscreenCanvasRenderingContext2D
OListElement
OptGroupElement
OptionElement
OrientationSensor
OutputElement
OverconstrainedError
PageTransitionEvent
PaintRenderingContext2D
PaintSize
PaintWorkletGlobalScope
ParagraphElement
ParamElement
ParentNode
PasswordCredential
PasswordInputElement
没有换行符的文本(敏感信息).
Path2D
PaymentAddress
PaymentInstruments
PaymentManager
PaymentRequest
PaymentRequestEvent
PaymentRequestUpdateEvent
PaymentResponse
Performance
PerformanceEntry
PerformanceLongTaskTiming
PerformanceMark
PerformanceMeasure
PerformanceNavigation
PerformanceNavigationTiming
PerformanceObserver
PerformanceObserverEntryList
PerformancePaintTiming
PerformanceResourceTiming
PerformanceServerTiming
PerformanceTiming
Permissions
PermissionStatus
PhotoCapabilities
PictureElement
Platform
Plugin
PluginArray
Point<T extends num>
表示二维位置的实用程序类.
PointerEvent
PopStateEvent
PositionError
PreElement
Presentation
PresentationAvailability
PresentationConnection
PresentationConnectionAvailableEvent
PresentationConnectionCloseEvent
PresentationConnectionList
PresentationReceiver
PresentationRequest
ProcessingInstruction
ProgressElement
ProgressEvent
PromiseRejectionEvent
PublicKeyCredential
PushEvent
PushManager
PushMessageData
PushSubscription
PushSubscriptionOptions
QuoteElement
RadioButtonInputElement
一个控件与其他ReadioButtonInputElement控件一起使用时,会形成一个单选按钮组,其中一次只能检查一个控件. [...]
Range
RangeInputElement
NumberInputElement相似,但浏览器可能会提供更好的样式(例如滑块控件). [...]
RangeInputElementBase
所有涉及范围的输入元素类型的基本接口.
ReadyState
包含HTMLDocument.getReadyState返回的一组标准值.
Rectangle<T extends num>
表示属性不可变的二维矩形的类.
RelatedApplication
RelativeOrientationSensor
RemotePlayback
ReportBody
ReportingObserver
ResetButtonInputElement
单击一个按钮会重置表单.
ResizeObserver
ResizeObserverEntry
RtcCertificate
RtcDataChannel
RtcDataChannelEvent
RtcDtmfSender
RtcDtmfToneChangeEvent
RtcIceCandidate
RtcLegacyStatsReport
RtcPeerConnection
RtcPeerConnectionIceEvent
RtcRtpContributingSource
RtcRtpReceiver
RtcRtpSender
RtcSessionDescription
RtcStatsReport
RtcStatsResponse
RtcTrackEvent
Screen
ScreenOrientation
ScriptElement
ScrollAlignment
Element.scrollIntoView的选项.
ScrollState
ScrollTimeline
SearchInputElement
TextInputElement相似,但在搜索样式不同的平台上,这将获得搜索样式. [...]
SecurityPolicyViolationEvent
SelectElement
Selection
Sensor
SensorErrorEvent
ServiceWorker
ServiceWorkerContainer
ServiceWorkerGlobalScope
ServiceWorkerRegistration
ShadowElement
ShadowRoot
SharedArrayBuffer
SharedWorker
SharedWorkerGlobalScope
SlotElement
SourceBuffer
SourceBufferList
SourceElement
SpanElement
SpeechGrammar
SpeechGrammarList
SpeechRecognition
SpeechRecognitionAlternative
SpeechRecognitionError
SpeechRecognitionEvent
SpeechRecognitionResult
SpeechSynthesis
SpeechSynthesisEvent
SpeechSynthesisUtterance
SpeechSynthesisVoice
StaticRange
Storage
Window.localStorageWindow.sessionStorage属性使用的类型. 存储实现为Map <String,String>. [...]
StorageEvent
StorageManager
StyleElement
StyleMedia
StylePropertyMap
StylePropertyMapReadonly
StyleSheet
SubmitButtonInputElement
单击一个按钮即可提交表单.
SyncEvent
SyncManager
TableCaptionElement
TableCellElement
TableColElement
TableElement
TableRowElement
TableSectionElement
TaskAttributionTiming
TelephoneInputElement
表示用于编辑电话号码的控件. [...]
TemplateElement
Text
TextAreaElement
TextDetector
TextEvent
TextInputElement
基本的文本输入编辑器控件.
TextInputElementBase
所有涉及文本编辑的输入的基本界面.
TextMetrics
TextTrack
TextTrackCue
TextTrackCueList
TextTrackList
TimeElement
TimeInputElement
没有时区的时间(小时,分钟,秒,小数秒). [...]
TimeRanges
TitleElement
Touch
TouchEvent
TouchList
TrackDefault
TrackDefaultList
TrackElement
TrackEvent
TransitionEvent
TreeWalker
TrustedHtml
TrustedScriptUrl
TrustedUrl
UIEvent
UListElement
UnderlyingSourceBase
UnknownElement
UriPolicy
定义关于特定属性值允许使用哪种类型的uri的策略. [...]
Url
UrlInputElement
用于编辑绝对URL的控件. [...]
UrlSearchParams
UrlUtilsReadOnly
ValidityState
VideoElement
VideoPlaybackQuality
VideoTrack
VideoTrackList
VisualViewport
VR
VRCoordinateSystem
VRDevice
VRDeviceEvent
VRDisplay
VRDisplayCapabilities
VRDisplayEvent
VREyeParameters
VRFrameData
VRFrameOfReference
VRPose
VRSession
VRSessionEvent
VRStageBounds
VRStageBoundsPoint
VRStageParameters
VttCue
VttRegion
WebSocket
使用WebSocket接口连接到WebSocket,并在该WebSocket上发送和接收数据. [...]
WeekInputElement
一个日期,它由一个星期年号和一个没有时区的星期号组成. [...]
WheelEvent
Window
当前浏览器选项卡或窗口的顶级容器. [...]
WindowBase
浏览器选项卡或窗口的顶级容器. [...]
WindowBase64
WindowClient
WindowEventHandlers
Worker
WorkerGlobalScope
WorkerPerformance
WorkletAnimation
WorkletGlobalScope
XmlDocument
XmlSerializer
XPathEvaluator
XPathExpression
XPathNSResolver
XPathResult
XsltProcessor

Properties

document HtmlDocument
网页中所有内容的根节点.
只读
window Window
网页的顶级容器,通常是浏览器选项卡或窗口. [...]
只读

Functions

promiseToFutureAsMap(dynamic jsPromise) Future<Map<String, dynamic>>
将JS Promise转换为Future <Map <String,dynamic >>. [...]
querySelector(String selectors) Element
查找与指定选择器组匹配的此文档的第一个后代元素. [...]
querySelectorAll<T extends Element>(String selectors) ElementList<T>
查找此文档中与指定选择器组匹配的所有后代元素. [...]

Typedefs

BlobCallback(Blob blob) → void
CustomElementConstructor() → void
DatabaseCallback(dynamic database) → void
DecodeErrorCallback(DomException error) → void
DecodeSuccessCallback(dynamic decodedData) → void
EventListener(Event event) → dynamic
FontFaceSetForEachCallback(FontFace fontFace, FontFace fontFaceAgain, FontFaceSet set) → void
对于任何类似setL的IDL条目,都需要回调签名. 今天只有一个.
FrameRequestCallback(num highResTime) → void
FunctionStringCallback(String data) → void
IdleRequestCallback(IdleDeadline deadline) → void
IntersectionObserverCallback(List entries, IntersectionObserver observer) → void
MediaSessionActionHandler() → void
MessageCallback(Map message) → void
MetadataCallback(Metadata metadata) → void
MojoWatchCallback(int result) → void
MutationCallback(List mutations, MutationObserver observer) → void
PerformanceObserverCallback(PerformanceObserverEntryList entries, PerformanceObserver observer) → void
RemotePlaybackAvailabilityCallback(bool available) → void
ReportingObserverCallback(List reports, ReportingObserver observer) → void
RequestAnimationFrameCallback(num highResTime) → void
ResizeObserverCallback(List entries, ResizeObserver observer) → void
RtcPeerConnectionErrorCallback(DomException exception) → void
RtcStatsCallback(RtcStatsResponse response) → void
ScrollStateCallback(ScrollState scrollState) → void
StorageErrorCallback(DomError error) → void
StorageQuotaCallback(int grantedQuotaInBytes) → void
StorageUsageCallback(int currentUsageInBytes, int currentQuotaInBytes) → void
TimeoutHandler() → void
VoidCallback() → void