| Depr. | Version |
|---|---|
| No | HTML 4 |
| IE8 | FF2 | SA4 | OP10 | CH2 |
|---|---|---|---|---|
| None | None | None | None | None |
Syntax
Description
The
declare attribute declares an object, but doesn’t
instantiate it, which may be useful for the purposes of deferring the
object’s download until it’s actually needed. In HTML, it’s not necessary
to include the attribute and value pairing—all we need is the attribute on
its own, as shown here:
<object data="giant-dog.jpg" declare
type="image/jpeg" height="225"></object>
Example
Here’s the
declare attribute, specified in XHTML-compliant
markup:
<object data="giant-dog.jpg" declare="declare"
type="image/jpeg" height="225"></object>
Value
"declare" is the
only value this attribute can take.
Compatibility
| Internet Explorer | Firefox | Safari | Opera | Chrome | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 5.5 | 6.0 | 7.0 | 8.0 | 1.0 | 1.5 | 2.0 | 1.3 | 2.0 | 3.1 | 4.0 | 9.2 | 9.5 | 10.0 | 2.0 |
| None | None | None | None | None | None | None | None | None | None | None | None | None | None | None |
In all browsers
tested, the presence of the declare attribute made
no difference at all—browsers instantiated the object regardless (in the
example above, an image of a large dog).
User-contributed notes
There are no comments yet.
Add a note
To post a note on this topic, please log in with your SitePoint username and password. If you don't have an account yet, you can create a new account for free.