internalSubset (W3C DOM Core property)
| Version | Depr. | Static | Read-only |
|---|---|---|---|
| DOM2 | No | No | Yes |
| 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.
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.