internalSubset (W3C DOM Core property)

Spec
Version Depr. Static Read-only
DOM2 No No Yes
Browser support (more…)
IE7 FF1.5+ SA3 OP9+
None Partial None Partial

Example

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
[
  <!ATTLIST input validate CDATA #IMPLIED>
  <!ATTLIST input range CDATA #IMPLIED>
]>

The example above shows an XHTML doctype with additional custom attributes, defined as an internal subset to the main DTD.

So to retrieve and store the contents of that internal subset (everything between, but not including, the starting [ and ending ]), we could do this:

var subset = document.doctype.internalSubset;

The text that comes back is a simple string, not a collection of nodes.

Description

A string containing the text of a DTD's internal subset.

This property is readonly.

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
None None None Partial Partial Partial None None None Partial Partial

Only Opera in XHTML mode1 and Firefox in XHTML mode or XML provide data for the internalSubset property; in Safari it's null, in Internet Explorer it's undefined, otherwise it's an empty string.

Footnotes

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

User-contributed notes

There are no comments yet.

Related Products