name (HTML attribute)

Spec
Depr. Version
Yes N/A

Syntax

name="unique name reference"

Description

The name attribute is one method for referencing an embed element by JavaScript (the alternative, forward-thinking method is to reference by the id (coming soon!) attribute). It has historically been used for techniques such as image swaps for rollovers (which have since largely been replaced using CSS techniques).

Example

The name attribute provides a way of referencing the object:
<embed src="giant-grasshopper.jpg" name="ghopper"></embed>

Value

Any name that the developer chooses (not containing spaces or special characters).

Compatibility

It causes no compatibility issues, and has excellent support across all tested browsers.

User-contributed notes

There are no comments yet.

Related Products