IHTMLElement2 interface
Provides methods to access the properties and methods that are common to all element objects.
Members
The IHTMLElement2 interface inherits from the IDispatch interface. IHTMLElement2 also has these types of members:
- Methods
- Properties
Methods
The IHTMLElement2 interface has these methods.
Method | Description |
---|---|
addBehavior | Attaches a behavior to the element. |
applyElement | Makes the element either a child or parent of another element. |
attachEvent |
Note IHTMLElement2::attachEvent is no longer supported. Starting with IE11, use IEventTarget::addEventListener. For info, see Compatibility changes.
Binds the specified function to an event, so that the function gets called whenever the event fires on the object. |
blur | Causes the element to lose focus and fires the HTMLFrameSiteEvents::onblur event. |
clearAttributes | Removes all attributes and values from the object. |
componentFromPoint | Returns the component located at the specified coordinates via certain events. |
createControlRange | Creates a controlRange collection of nontext elements. |
detachEvent | Unbinds the specified function from the event, so that the function stops receiving notifications when the event fires. |
doScroll |
Note IHTMLElement2::doScroll is no longer supported. Starting with IE11, use IHTMLElement2::scrollLeft or IHTMLElement2::scrollTop. For info, see Compatibility changes.
Simulates a click on a scroll bar component. |
focus | Causes the element to receive the focus and executes the code specified by the HTMLFrameSiteEvents::onfocus event. |
getAdjacentText | Returns the adjacent text string. |
getBoundingClientRect | Retrieves an object that specifies the bounds of a collection of TextRectangle objects. |
getClientRects | Retrieves a collection of rectangles that describes the layout of the contents of an object or range within the client. Each rectangle describes a single line. |
getElementsByTagName | Retrieves a collection of objects based on the specified element name. |
getExpression | This element is obsolete and should no longer be used. Retrieves the expression for the given property. |
insertAdjacentElement | Inserts an element at the specified location. |
mergeAttributes | Copies all read/write attributes to the specified element. |
releaseCapture | Removes mouse capture from the object in the current document. |
removeBehavior | Detaches a behavior from the element. |
removeExpression | This element is obsolete and should no longer be used. Removes the expression from the specified property. |
replaceAdjacentText | Replaces the text adjacent to the element. |
setCapture | Sets the mouse capture to the object that belongs to the current document. |
setExpression | This element is obsolete and should no longer be used. Sets an expression for the specified object. |
Properties
The IHTMLElement2 interface has these properties.
Property | Description |
---|---|
Sets or retrieves the access key for the object. |
|
Gets a value indicating whether the object can contain child objects. |
|
Retrieves the height of the object including padding, but not including margin, border, or scroll bar. |
|
Retrieves the distance between the IHTMLElement::offsetLeft property and the true left side of the client area. |
|
Retrieves the distance between the IHTMLElement::offsetTop property and the true top of the client area. |
|
Retrieves the width of the object including padding, but not including margin, border, or scroll bar. |
|
Gets a reference to the currentStyle object, which represents the current cascaded format and style specified by global style sheets, inline styles, and HTML attributes. |
|
Sets or retrieves the reading order of the object. |
|
Sets or gets a pointer to the event handler function associated with the event. |
|
Sets or gets a pointer to the event handler function associated with the event. |
|
Sets or retrieves a pointer to the event handler function associated with the HTMLFrameSiteEvents::onbeforeeditfocus event. |
|
Sets or gets a pointer to the event handler function associated with the event. |
|
Sets or retrieves a pointer to the event handler function associated with the HTMLFrameSiteEvents::onblur event. |
|
Sets or retrieves a pointer to the event handler function associated with the HTMLFrameSiteEvents::oncellchange event. |
|
Sets or retrieves a pointer to the event handler function associated with the HTMLFrameSiteEvents::oncontextmenu event. |
|
Sets or gets a pointer to the event handler function associated with the event. |
|
Sets or gets a pointer to the event handler function associated with the event. |
|
Sets or gets a pointer to the event handler function associated with the HTMLFrameSiteEvents::ondrag event. |
|
Sets or gets a pointer to the event handler function associated with the HTMLFrameSiteEvents::ondragend event. |
|
Sets or gets a pointer to the event handler function associated with the HTMLFrameSiteEvents::ondragenter event. |
|
Sets or gets a pointer to the event handler function associated with the HTMLFrameSiteEvents::ondragleave event. |
|
Sets or gets a pointer to the event handler function associated with the HTMLFrameSiteEvents::ondragover event. |
|
Sets or gets a pointer to the event handler function associated with the HTMLFrameSiteEvents::ondrop event. |
|
Sets or retrieves a pointer to the event handler function associated with the HTMLFrameSiteEvents::onfocus event. |
|
Sets or gets a pointer to the event handler function associated with the event. |
|
Sets or gets a pointer to the event handler function associated with the event. |
|
Sets or retrieves a pointer to the event handler function associated with the HTMLFrameSiteEvents::onpropertychange event. |
|
Sets or retrieves a pointer to the event handler function associated with the HTMLFrameSiteEvents::onresize event. |
|
Sets or retrieves a pointer to the event handler function associated with the HTMLFrameSiteEvents::onrowsdelete event. |
|
Sets or retrieves a pointer to the event handler function associated with the HTMLFrameSiteEvents::onrowsinserted event. |
|
Sets or retrieves a pointer to the event handler function associated with the HTMLFrameSiteEvents::onscroll event. |
|
Retrieves the current state of the object. |
|
Gets the element's runtimeStyle object. |
|
Gets the namespace defined for the element. This property is not supported for Windows apps using JavaScript. |
|
Retrieves the scrolling height of the object. |
|
Sets or retrieves the distance between the left edge of the object and the leftmost portion of the content currently visible in the window. |
|
Sets or retrieves the distance between the top of the object and the topmost portion of the content currently visible in the window. |
|
Retrieves the scrolling width of the object. |
|
Sets or retrieves the index that defines the tab order for the object. |
|
Sets or gets the URN specified in the namespace declaration. This property is not supported for Windows apps using JavaScript. |
Requirements
Minimum supported client |
Windows XP |
Minimum supported server |
Windows 2000 Server |
Header |
Mshtml.h |
IDL |
Mshtml.idl |
DLL |
Mshtml.dll |