共用方式為


IDocumentSelector interface

Implements the W3C Selectors API. The selectors API supports searching for one or more elements that match a given CSS Selector string.

Members

The IDocumentSelector interface inherits from the IDispatch interface. IDocumentSelector also has these types of members:

  • Methods

Methods

The IDocumentSelector interface has these methods.

Method Description
querySelector

Retrieves the first DOM element node from descendants of the starting element node that match any selector within the supplied selector string.

querySelectorAll

Retrieves all DOM element nodes from descendants of the starting element node that match any selector within the supplied selector strings.

 

Remarks

Note   The Selectors API will only function in IE8 Standards mode.

 

This API is faster than the equivalent JavaScript methods.

Requirements

Minimum supported client

Windows XP with SP2

Minimum supported server

Windows Server 2003

Header

Mshtml.h

IDL

Mshtml.idl

DLL

Mshtml.dll

See also

IDispatch

Reference

IElementSelector

Conceptual

Selecting Objects with JavaScript

Other Resources

W3C Selectors API

W3C Selectors