Dofactory.com
Dofactory.com

HTML <object> name Attribute

The name attribute on an <object> tag assigns a name to that object element.

This name is the browsing context of the element.

Example

#

A name attribute on an <object> element.
The name represents the browsing context of the element (see details below).

PDF cannot be displayed.
<object data="/media/sample.pdf" type="application/pdf"
        style="width:100%;height:500px;" name="sample-pdf">
   PDF cannot be displayed.
</object>

Using name

The name attribute assigns a name to the object element.

The name is the browsing context of the object element. The browsing context can be thought of as a mini-browser inside the browser. It has session history, a Document object, and more -- much like a browser does.

The name attribute can also be used as a reference by Javascript.


Syntax

<object name="name">

Values

#

Value Description
name String value. The browsing context of the object.

Browser support

Here is when name support started for each browser:

Chrome
1.0 Sep 2008
Firefox
1.0 Sep 2002
IE/Edge
1.0 Aug 1995
Opera
1.0 Jan 2006
Safari
1.0 Jan 2003

You may also like

 Back to <object>

Author: Jack Poorte
Published: Jun 20 2021
Last Reviewed: Sep 30 2023


What's your favorite/least favorite part of Dofactory?


Guides