The object element is used to insert a file into the document. That file can be of any type, an image, a text file, a video or audio, or even a file written in another language such as a flash based animation.

A browser will always try to render an object element and if for some reason it cannot be done, it should try to somehow render its content.

The element as a URI source uses data or classid attributes, depending on the type of a file being inserted.

An object element can also be nested under other <object> tag or tags but in that case a browser must read the content but not render it unless the parent <object> tag cannot be executed.

The param element is always a child to an object element. It is used when there are other values of the object to be specified at run-time and it comes in name / value pairs as attributes. For instance <param> tag can define the width and the height of an element or "tell" the browser to automatically repeat a flash animation.

This code editor below is a combination of a form's textarea and an object.

The object element is added to the HTML to replace older and deprecated elements <applet> and <embed> so older browser might not be able to render it.

Param is an empty tag, therefore the closing tag is forbidden.

Syntax:

<object data="URI" type=""><param name="" value="" /></object>

Attributes:

Example

HTML object elements:

 

›› go to examples ››