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:
- id (document-wide identifiers)
- class (<object>) (document-wide identifiers)
- lang (<object>) (language information), dir (text direction)
- title (<object>) (element title)
- style (<object>) (inline style information)
- name (elements name)
- value, valuetype (<param />) (param specific attributes)
- type (objects type)
- classid, codebase, codetype, data, archive, declare, standby (<object>) (object specific attributes)
- tabindex (<object>) (tabbing navigation)
- usemap (client side image maps)
- width, height (<object>) (visual presentation of objects and images)
- onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup (<object>) (intrinsic events)
Example
HTML object elements:
Comments
No comments have been made yet.
Please login to leave a comment. Login now