publicId (W3C DOM Core property)

Spec
Version Depr. Static Read-only
DOM1 No No Yes
Browser support (more…)
IE5.5+ FF1.5+ SA3+ OP9+
Partial Full Full Full

Example

var pubid = document.doctype.publicId;

The example above saves a reference to the publicId of the doctype. So if we were on a page with an XHTML 1.0 Strict doctype, the pubid variable would have the value -//W3C//DTD XHTML 1.0 Strict//EN.

Description

The public identifier of an Entity, or null if no public identifier is specified.

This property is read-only.

Compatibility

Internet Explorer Firefox Safari Opera
5.5 6.0 7.0 1.5 2.0 3.0 1.3 2.0 3.0 9.0 9.5
Partial Partial Partial Full Full Full None None Full Full Full

Only Opera in XHTML mode or XML1 and Internet Explorer in XML are able to retrieve the publicId of an Entity or Notation, because those are the only environments in which the root objects themselves are exposed (see Entity and Notation for details).

Footnotes

1 On XHTML pages served as application/xhtml+xml.

User-contributed notes

There are no comments yet.

Related Products