<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>判断页面是否添加了W3C声明</title>
<script>
if (document.compatMode=="CSS1Compat")
alert("本文档添加了W3C的声明")
else
alert("本文档未添加W3C的声明")
</script>
</head>
<body>
本例的重点是“document.compatMode”变量的值。当文档有了标准声明时,“document.compatMode” 的值就等于“CSS1Compat”。
</body>
</html>

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-21
  • 2021-11-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-19
  • 2021-07-28
  • 2022-12-23
  • 2021-08-27
  • 2022-01-12
  • 2022-12-23
相关资源
相似解决方案