HTMLObjectElement

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.

特性

Inherits properties from its parent, HTMLElement .

HTMLObjectElement.align
DOMString representing an enumerated property indicating alignment of the element's contents with respect to the surrounding context. The possible values are "left" , "right" , "justify" ,和 "center" .
HTMLObjectElement.archive
DOMString that reflects the archive HTML attribute, containing a list of archives for resources for this object.
HTMLObjectElement.border
DOMString that reflects the border HTML attribute, specifying the width of a border around the object.
HTMLObjectElement.code
DOMString representing 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.
HTMLObjectElement.codeBase
DOMString that reflects the codebase HTML attribute, specifying the base path to use to resolve relative URIs.
HTMLObjectElement.codeType
DOMString that reflects the codetype HTML attribute, specifying the content type of the data.
HTMLObjectElement.contentDocument 只读
返回 Document representing the active document of the object element's nested browsing context, if any; otherwise null .
HTMLObjectElement.contentWindow 只读
返回 WindowProxy representing the window proxy of the object element's nested browsing context, if any; otherwise null .
HTMLObjectElement.data
返回 DOMString that reflects the data HTML attribute, specifying the address of a resource's data.
HTMLObjectElement.declare
Boolean that reflects the declare HTML attribute, indicating that this is a declaration, not an instantiation, of the object.
HTMLObjectElement.form 只读
Retuns a HTMLFormElement representing the object element's form owner, or null if there isn't one.
HTMLObjectElement.height
返回 DOMString that reflects the height HTML attribute, specifying the displayed height of the resource in CSS pixels.
HTMLObjectElement.hspace
long representing the horizontal space in pixels around the control.
HTMLObjectElement.name
返回 DOMString that reflects the name HTML attribute, specifying the name of the browsing context.
HTMLObjectElement.standby
DOMString that reflects the standby HTML attribute, specifying a message to display while the object loads.
HTMLObjectElement.tabindex
long representing the position of the element in the tabbing navigation order for the current document.
HTMLObjectElement.type
DOMString that reflects the type HTML attribute, specifying the MIME type of the resource.
HTMLObjectElement.typeMustMatch
Boolean that reflects the typemustmatch HTML attribute, indicating if the resource specified by data must only be played if it matches the type 属性。
HTMLObjectElement.useMap
DOMString that reflects the usemap HTML attribute, specifying a <map> element to use.
HTMLObjectElement.validationMessage 只读
返回 DOMString representing 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.
HTMLObjectElement.validity 只读
返回 ValidityState with the validity states that this element is in.
HTMLObjectElement.vspace
long representing the horizontal space in pixels around the control.
HTMLObjectElement.width
DOMString that reflects the width HTML attribute, specifying the displayed width of the resource in CSS pixels.
HTMLObjectElement.willValidate 只读
返回 Boolean that indicates whether the element is a candidate for constraint validation. Always false for HTMLObjectElement 对象。

方法

Inherits methods from its parent, HTMLElement .

HTMLObjectElement.checkValidity()
Retuns a Boolean that always is true , because object objects are never candidates for constraint validation.
HTMLObjectElement.setCustomValidity()
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.

规范

规范 状态 Comment
HTML Living Standard
The definition of 'HTMLObjectElement' in that specification.
实时标准
HTML5
The definition of 'HTMLObjectElement' in that specification.
Recommendation The W3C specification is a latest of a previous version of HTML Living Standard
Technically, the property tabindex is now defined on HTMLElement .
The following properties are now obsolete: align , archive , border , code , codeBase , codeType , declare , hspace , standby ,和 vspace .
The following properties have been added: typeMustMatch , contentWindow , willValidate , validity ,和 validationMessage .
The following methods have been added: checkValidity() and setCustomValidity() .
Document Object Model (DOM) Level 2 HTML Specification
The definition of 'HTMLObjectElement' in that specification.
Obsolete contentDocument property has been added.
Document Object Model (DOM) Level 1 Specification
The definition of 'HTMLObjectElement' in that specification.
Obsolete 初始定义。

浏览器兼容性

更新 GitHub 上的兼容性数据
Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
HTMLObjectElement Chrome 1 Edge 12 Firefox 1 IE Yes Opera Yes Safari Yes WebView Android 37 Chrome Android 18 Firefox Android 4 Opera Android Yes Safari iOS Yes Samsung Internet Android 1.0
align
弃用
Chrome 1 Edge 12 Firefox 1 IE Yes Opera Yes Safari 6 WebView Android 37 Chrome Android 18 Firefox Android 4 Opera Android Yes Safari iOS Yes Samsung Internet Android 1.0
archive
弃用
Chrome 1 Edge 12 Firefox 1 IE Yes Opera Yes Safari 6 WebView Android 37 Chrome Android 18 Firefox Android 4 Opera Android Yes Safari iOS Yes Samsung Internet Android 1.0
border
弃用
Chrome 1 Edge 12 Firefox 1 IE Yes Opera Yes Safari 6 WebView Android 37 Chrome Android 18 Firefox Android 4 Opera Android Yes Safari iOS Yes Samsung Internet Android 1.0
checkValidity Chrome 46 Edge 12 Firefox 1 IE Yes Opera Yes Safari 6 WebView Android 46 Chrome Android 46 Firefox Android 4 Opera Android Yes Safari iOS Yes Samsung Internet Android 5.0
code
弃用
Chrome 1 Edge 12 Firefox 1 IE Yes Opera Yes Safari 6 WebView Android 37 Chrome Android 18 Firefox Android 4 Opera Android Yes Safari iOS Yes Samsung Internet Android 1.0
codeBase
弃用
Chrome 1 Edge 12 Firefox 1 IE Yes Opera Yes Safari 6 WebView Android 37 Chrome Android 18 Firefox Android 4 Opera Android Yes Safari iOS Yes Samsung Internet Android 1.0
codeType
弃用
Chrome 1 Edge 12 Firefox 1 IE Yes Opera Yes Safari 6 WebView Android 37 Chrome Android 18 Firefox Android 4 Opera Android Yes Safari iOS Yes Samsung Internet Android 1.0
contentDocument Chrome 1 Edge 12 Firefox 1 IE Yes Opera 40 Safari 10 WebView Android 37 Chrome Android 18 Firefox Android 4 Opera Android 41 Safari iOS Yes Samsung Internet Android 1.0
contentWindow Chrome 53 Edge 17 Firefox Yes IE No Opera No Safari No WebView Android 53 Chrome Android 53 Firefox Android No Opera Android No Safari iOS No Samsung Internet Android 6.0
data Chrome 1 Edge 12 Firefox 1 IE Yes Opera Yes Safari 6 WebView Android 37 Chrome Android 18 Firefox Android 4 Opera Android Yes Safari iOS Yes Samsung Internet Android 1.0
declare
弃用
Chrome 46 Edge 12 Firefox 1 IE Yes Opera Yes Safari 6 WebView Android 46 Chrome Android 46 Firefox Android 4 Opera Android Yes Safari iOS Yes Samsung Internet Android 5.0
form Chrome 46 Edge 12 Firefox 1 IE Yes Opera Yes Safari 6 WebView Android 46 Chrome Android 46 Firefox Android 4 Opera Android Yes Safari iOS Yes Samsung Internet Android 5.0
getSVGDocument Chrome Yes Edge 12 Firefox Yes IE No Opera Yes Safari 6 WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
height Chrome 1 Edge 12 Firefox 1 IE Yes Opera Yes Safari 6 WebView Android 37 Chrome Android 18 Firefox Android 4 Opera Android Yes Safari iOS Yes Samsung Internet Android 1.0
hspace
弃用
Chrome 46 Edge 12 Firefox 1 IE Yes Opera Yes Safari 6 WebView Android 46 Chrome Android 46 Firefox Android 4 Opera Android Yes Safari iOS Yes Samsung Internet Android 5.0
name Chrome 1 Edge 12 Firefox 1 IE Yes Opera Yes Safari 6 WebView Android 37 Chrome Android 18 Firefox Android 4 Opera Android Yes Safari iOS Yes Samsung Internet Android 1.0
reportValidity Chrome Yes Edge 18 Firefox 1 IE Yes Opera Yes Safari 10 WebView Android Yes Chrome Android Yes Firefox Android 4 Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
setCustomValidity Chrome Yes Edge 12 Firefox 1 IE Yes Opera Yes Safari 6 WebView Android Yes Chrome Android Yes Firefox Android 4 Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
standby
弃用
Chrome 1 Edge 12 Firefox 1 IE Yes Opera Yes Safari 6 WebView Android 37 Chrome Android 18 Firefox Android 4 Opera Android Yes Safari iOS Yes Samsung Internet Android 1.0
type Chrome 1 Edge 12 Firefox 1 IE Yes Opera Yes Safari 6 WebView Android 37 Chrome Android 18 Firefox Android 4 Opera Android Yes Safari iOS Yes Samsung Internet Android 1.0
typeMustMatch Chrome No Edge No Firefox 27 IE No Opera No Safari No WebView Android No Chrome Android No Firefox Android 27 Opera Android No Safari iOS No Samsung Internet Android No
useMap Chrome 1 Edge 12 Firefox 1 IE Yes Opera Yes Safari 6 WebView Android 37 Chrome Android 18 Firefox Android 4 Opera Android Yes Safari iOS Yes Samsung Internet Android 1.0
validationMessage Chrome 46 Edge 12 Firefox 1 IE Yes Opera Yes Safari 6 WebView Android 46 Chrome Android 46 Firefox Android 4 Opera Android Yes Safari iOS Yes Samsung Internet Android 5.0
validity Chrome 46 Edge 12 Firefox 1 IE Yes Opera Yes Safari 6 WebView Android 46 Chrome Android 46 Firefox Android 4 Opera Android Yes Safari iOS Yes Samsung Internet Android 5.0
vspace
弃用
Chrome 46 Edge 12 Firefox 1 IE Yes Opera Yes Safari 6 WebView Android 46 Chrome Android 46 Firefox Android 4 Opera Android Yes Safari iOS Yes Samsung Internet Android 5.0
width Chrome 1 Edge 12 Firefox 1 IE Yes Opera Yes Safari 6 WebView Android 37 Chrome Android 18 Firefox Android 4 Opera Android Yes Safari iOS Yes Samsung Internet Android 1.0
willValidate Chrome 46 Edge 12 Firefox 1 IE Yes Opera Yes Safari 6 WebView Android 46 Chrome Android 46 Firefox Android 4 Opera Android Yes Safari iOS Yes Samsung Internet Android 5.0

图例

完整支持
完整支持
不支持
不支持
弃用。不要用于新网站。
弃用。不要用于新网站。

另请参阅

  • The HTML element implementing this interface: <object>
  1. HTMLObjectElement
  2. 特性
    1. contentDocument
    2. contentWindow
    3. data
    4. form
    5. height
    6. name
    7. type
    8. typeMustMatch
    9. useMap
    10. validationMessage
    11. validity
    12. width
    13. willValidate
  3. 方法
    1. checkValidity
    2. setCustomValidity
  4. 继承:
    1. HTMLElement
    2. Element
    3. Node
    4. EventTarget
  5. Related pages for HTML DOM
    1. BeforeUnloadEvent
    2. DOMStringMap
    3. ErrorEvent
    4. GlobalEventHandlers
    5. HTMLAnchorElement
    6. HTMLAreaElement
    7. HTMLAudioElement
    8. HTMLBRElement
    9. HTMLBaseElement
    10. HTMLBaseFontElement
    11. HTMLBodyElement
    12. HTMLButtonElement
    13. HTMLCanvasElement
    14. HTMLContentElement
    15. HTMLDListElement
    16. HTMLDataElement
    17. HTMLDataListElement
    18. HTMLDialogElement
    19. HTMLDivElement
    20. HTMLDocument
    21. HTMLElement
    22. HTMLEmbedElement
    23. HTMLFieldSetElement
    24. HTMLFormControlsCollection
    25. HTMLFormElement
    26. HTMLFrameSetElement
    27. HTMLHRElement
    28. HTMLHeadElement
    29. HTMLHeadingElement
    30. HTMLHtmlElement
    31. HTMLIFrameElement
    32. HTMLImageElement
    33. HTMLInputElement
    34. HTMLIsIndexElement
    35. HTMLKeygenElement
    36. HTMLLIElement
    37. HTMLLabelElement
    38. HTMLLegendElement
    39. HTMLLinkElement
    40. HTMLMapElement
    41. HTMLMediaElement
    42. HTMLMetaElement
    43. HTMLMeterElement
    44. HTMLModElement
    45. HTMLOListElement
    46. HTMLOptGroupElement
    47. HTMLOptionElement
    48. HTMLOptionsCollection
    49. HTMLOutputElement
    50. HTMLParagraphElement
    51. HTMLParamElement
    52. HTMLPictureElement
    53. HTMLPreElement
    54. HTMLProgressElement
    55. HTMLQuoteElement
    56. HTMLScriptElement
    57. HTMLSelectElement
    58. HTMLShadowElement
    59. HTMLSourceElement
    60. HTMLSpanElement
    61. HTMLStyleElement
    62. HTMLTableCaptionElement
    63. HTMLTableCellElement
    64. HTMLTableColElement
    65. HTMLTableDataCellElement
    66. HTMLTableElement
    67. HTMLTableHeaderCellElement
    68. HTMLTableRowElement
    69. HTMLTableSectionElement
    70. HTMLTemplateElement
    71. HTMLTextAreaElement
    72. HTMLTimeElement
    73. HTMLTitleElement
    74. HTMLTrackElement
    75. HTMLUListElement
    76. HTMLUnknownElement
    77. HTMLVideoElement
    78. HashChangeEvent
    79. History
    80. ImageData
    81. Location
    82. MessageChannel
    83. MessageEvent
    84. MessagePort
    85. Navigator
    86. NavigatorGeolocation
    87. NavigatorID
    88. NavigatorLanguage
    89. NavigatorOnLine
    90. NavigatorPlugins
    91. PageTransitionEvent
    92. Plugin
    93. PluginArray
    94. PopStateEvent
    95. PortCollection
    96. PromiseRejectionEvent
    97. RadioNodeList
    98. Transferable
    99. ValidityState
    100. Window
    101. WindowBase64
    102. WindowEventHandlers
    103. WindowTimers