asp.net.ph

Skip Navigation LinksHome > Abakada: Back to Basics > Language References > HTML Elements > OBJECT Element

<object> Element


Inserts an object into the HTML page.HTML 2, 3.2, 4, 4.01, 5

HTML Syntax

NOTE: Both start and end tags are required.

Remarks

The <object> element can be used to embed a variety of object types in an HTML page. Among these types are plug-ins, Java components, ActiveX controls, applets, and images.

The object element’s attributes determine the type of object to embed, including the type and location of the object’s code implementation, and the type and implementation of the object’s data.

object supports alternative representations if the browser is not capable of supporting the object.

The element can contain other HTML attributes, including other object elements, nested between its opening and closing tags. If the browser supports the object, it ignores all the nested HTML except the <param> element. If it does not support the object, it parses the nested HTML but ignores the object and param elements.

object can appear in the <head> or the <body> of a document.

Attributes

The <object> element supports the following attributes, in addition to global attributes common to all HTML elements.

AttributeValueDescription
dataURLSpecifies the URL of the resource to be used by the object
formform_idSpecifies which form the object belongs to
heightpixelsSpecifies the height of the object
namenameSpecifies a name for the object
typemedia_typeSpecifies the media type of data specified in the data attribute
typemustmatchtrue/falseSpecifies whether the type attribute and the actual content of the resource must match to be displayed
usemap#mapnameSpecifies the name of a client-side image map to be used with the object
widthpixelsSpecifies the width of the object

Example

The following example shows how the <object> element may be used.

<object codebase="classes" classid="ticker.obj"
 data="data" width="150" height="250">
Notes on DOM Access

The properties accessible for an object element depend on the contents of the object. As such, possible values returned will depend on the implementation of the object.

For example, the readyState property will return null or an error if the object does not implement a readyState property.

Authors should refer to the documentation for the individual object for supported properties.

External References

See Also

AUDIO   EMBED   PICTURE   VIDEO



Check out related books at Amazon

© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note