Dofactory.com
Dofactory.com
Earn income with your HTML skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.

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>

Last updated on Sep 30, 2023

Earn income with your HTML skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.

Guides