<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<script type ="text/javascript">
window.onload = function () {
document.title = "我的网页";
document.bgColor = "red"; //背景色 ,修改文档的背景色
document.fgColor = "yellow";//前景色,修改文档内容颜色
document.characterSet = "utf-8";//修改页面的编码,
document.write("");//动态向页面写入内容。如果在window.onload里面写,会清空覆盖之前所有的文档内容
document.getElementById("");
document.getElementsByName("");//获取对象的集合
document.getElementsByTagName("P");//获取p元素的集合
document.all;//获取页面里的元素集合
document.forms;//获取所有表达对象的集合
document.forms[0].childNodes.length;//获取子元素的个数
document.images;//获取所有图片元素的集合
document.links;//获取所有链接的集合
}
</script>
</head>
<body>
</body>
</html>
原文:http://www.cnblogs.com/sumg/p/3787777.html