HTMLObjectElement

The HTMLObjectElement interface provides special properties and methods (beyond those on the HTMLElement interface it also has available to it by inheritance) for manipulating the layout and presentation of <object> element, representing external resources.

Properties

Inherits properties from its parent, HTMLElement.

Name Type Description
align  DOMString Enumerated property indicating alignment of the element's contents with respect to the surrounding context. The possible values are "left", "right", "justify", and "center".
archive  DOMString Reflects the archive HTML attribute, containing a list of archives for resources for this object.
border  DOMString Reflects the border HTML attribute, specifying the width of a border around the object.
code  DOMString The name of an applet class file, containing either the applet's subclass, or the path to get to the class, including the class file itself.
codeBase  DOMString Reflects the codebase HTML attribute, specifying the base path to use to resolve relative URIs.
codeType  DOMString Reflects the codetype HTML attribute, specifying the content type of the data.
contentDocument Read only Document The active document of the object element's nested browsing context, if any; otherwise null.
contentWindow Read only WindowProxy The window proxy of the object element's nested browsing context, if any; otherwise null.
data DOMString Reflects the data HTML attribute, specifying the address of a resource's data.
declare  Boolean Reflects the declare HTML attribute, indicating that this is a declaration, not an instantiation, of the object.
form Read only HTMLFormElement The object element's form owner, or null if there isn't one.
height DOMString Reflects the height HTML attribute, specifying the displayed height of the resource in CSS pixels.
hspace  long Horizontal space in pixels around the control.
name DOMString Reflects the name HTML attribute, specifying the name of the object (HTML 4, or of a browsing context (HTML5.
standby  DOMString Reflects the standby HTML attribute, specifying a message to display while the object loads.
tabindex long The position of the element in the tabbing navigation order for the current document.
type DOMString Reflects the type HTML attribute, specifying the MIME type of the resource.
typeMustMatch Boolean Reflects the typemustmatch HTML attribute, indicating if the resource specified by data must only be played if it matches the type attribute.
useMap DOMString Reflects the usemap HTML attribute, specifying a <map> element to use.
validationMessage Read only DOMString A localized message that describes the validation constraints that the control does not satisfy (if any). This is the empty string if the control is not a candidate for constraint validation (willValidate is false), or it satisfies its constraints.
validity Read only ValidityState The validity states that this element is in.
vspace  long Horizontal space in pixels around the control.
width DOMString Reflects the width HTML attribute, specifying the displayed width of the resource in CSS pixels.
willValidate Read only Boolean Indicates whether the element is a candidate for constraint validation. Always false for HTMLObjectElement objects.

Methods

Inherits methods from its parent, HTMLElement.

Name & Arguments Return Description
checkValidity() Boolean Always returns true, because object objects are never candidates for constraint validation.
setCustomValidity(in DOMString error) void Sets a custom validity message for the element. If this message is not the empty string, then the element is suffering from a custom validity error, and does not validate.

Specifications

Specification Status Comment
WHATWG HTML Living Standard Living Standard No change from HTML5.
HTML5 Candidate Recommendation Technically, the property tabindex is now defined on HTMLElement.
The following properties are now obsolete: align, archive, border, code, codeBase, codeType, declare, hspace, standby, and vspace.
The following properties have been added: typeMustMatch, contentWindow, willValidate, validity, and validationMessage.
The following methods have been added: checkValidity() and setCustomValidity().
Document Object Model (DOM) Level 2 HTML Specification Recommendation The contentDocument property has been added.
Document Object Model (DOM) Level 1 Specification Recommendation Initial definition.

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support (Yes) 1.0 (1.7 or earlier) (Yes) (Yes) (Yes)
typeMustMatch ? Not supported (bug 827160) ? ? ?
contentWindow ? Not supported (bug 678460) ? ? ?
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support (Yes) 1.0 (1.0) (Yes) (Yes) (Yes)
typeMustMatch ? Not supported (bug 827160) ? ? ?
contentWindow ? Not supported (bug 678460) ? ? ?

See also

  • The HTML element implementing this interface: <object>

Document Tags and Contributors

Contributors to this page: Sheppy, Dikrib, jswisher, ethertank, trevorh, kscarfone, teoli
Last updated by: teoli,