all
alt
ch
dir
id
min
rel
top
url
URL
urn
Expand Minimize

compatMode property

Gets a value that indicates whether standards-compliant mode is switched on for the object.

Syntax

JavaScript

p = object.compatMode

Property values

Type: String

BackCompat

Standards-compliant mode is not switched on.

CSS1Compat

Standards-compliant mode is switched on.

Examples

The !DOCTYPE declarations in the following examples specify conformance to the Transitional HTML 4.0 DTD. The declaration in the second example specifies the URL of the DTD. The declaration in the first example does not. The second declaration switches on standards-compliant mode with a Windows Store app using JavaScript. The first declaration does not.

The compatMode property returns BackCompat with documents containing the declaration in the following example. This declaration does not switch on standards-compliant mode because it does not specify the URL of the Transitional HTML 4.0 DTD.


<!DOCTYPE html public "-//W3C//DTD HTML 4.0 Transitional//en">

The compatMode property returns CSS1Compat with documents containing the declaration in the following example. This declaration switches on standards-compliant mode because it specifies the URL of the Transitional HTML 4.0 DTD.


<!DOCTYPE html public "-//W3C//DTD HTML 4.0 Transitional//en" 
    "http://www.w3.org/TR/html4/loose.dtd">

See also

document
Reference
documentMode

 

 

Show:
© 2014 Microsoft