
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
HTML DOM Object Object
The HTML DOM Object Object in HTML represents the <object> element.
Creating an <object> element
var objectElement = document.createElement(“OBJECT”)
Here, “objectElement” can have the following properties −
Property | Description |
---|---|
data | Itsets/returns the URL of the resource being used by the objectelement |
form | Itreturns a reference to the enclosing form of the object element |
height | Itsets/returns the height of the object element |
name | Itsets/returns the name of the object element |
type | Itsets/returns the content type for data downloaded via the dataattribute |
useMap | Itsets/returns the name of a client-side image map to be used withthe object element |
width | Itsets/returns the width of the object element |
Let us see an example of HTML DOM Object Object property −
Example
<!DOCTYPE html> <html> <head> <title>HTML DOM Object object</title> <style> form { width:70%; margin: 0 auto; text-align: center; } * { padding: 2px; margin:5px; } input[type="button"] { border-radius: 10px; } </style></head> <body> <form> <fieldset> <legend>HTML-DOM-Object-Object</legend> <object id="objSelect" height="200" data="https://www.tutorialspoint.com/spring/images/spring-mini-logo.jpg"></object> <input type="button" onclick="getObjectData()" value="Get URL"> <div id="divDisplay"></div> </fieldset> </form> <script> var divDisplay = document.getElementById("divDisplay"); var objSelect = document.getElementById("objSelect"); function getObjectData() { objSelect.data divDisplay.textContent = 'URL of above picture: '+objSelect.data; } </script> </body> </html>
Output
Before clicking ‘Get URL’ button −
After clicking ‘Get URL’ button −
- Related Articles
- HTML DOM HTML Object
- HTML DOM Ins Object
- HTML DOM HR Object
- HTML DOM Variable Object
- HTML DOM aside Object
- HTML DOM Anchor Object
- HTML DOM TableData Object
- HTML DOM TableHeader Object
- HTML DOM TableRow Object
- HTML DOM Textarea Object
- HTML DOM Meter Object
- HTML DOM MouseEvent Object
- HTML DOM Nav Object
- HTML DOM Ol Object
- HTML DOM Time Object

Advertisements