
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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 −
Advertisements