 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP 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
 