
- 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 type Property
The HTML DOM Object type Property is used to set or return the value of the type attribute of an object. However, the type attribute is used to set the media type like the object.
Following is the syntax to set the type property −
obj.type = type_of_media
Above, type_of_media is the standard media type, for example, image/bmp, image/tiff, image/tff, etc.
Following is the syntax to return the type property −
obj.type
Let us now see an example to implement the DOM Object type property −
Example
<!DOCTYPE html> <html> <body> <object id="obj" width="450" height="200" data="https://www.tutorialspoint.com/flex/samples/CSSApplication.swf" type="application/vnd.adobe.flash-movie"></object> <button onclick="display()">Display the media type</button> <p id="pid"></p> <script> function display() { var x = document.getElementById("obj").type; document.getElementById("pid").innerHTML = x; } </script> </body> </html>
Output
Click the button to display the type −
- Related Articles
- HTML DOM Ol type Property
- HTML DOM Event type Property
- HTML DOM Anchor type Property
- HTML DOM Button type Property
- HTML DOM Select type Property
- HTML DOM Link type Property
- HTML DOM Fieldset type property
- HTML DOM Object data Property
- HTML DOM Object form Property
- HTML DOM Object Height Property
- HTML DOM Object Width Property
- HTML DOM Object name Property
- HTML DOM Input Button type Property
- HTML DOM Input FileUpload type Property
- HTML DOM Input Hidden type Property

Advertisements