<!DOCTYPE html> <html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Index20140825</title>
</head>
<body>
<div>
<input type="button" name="" value="点击" id="btn" />
</div>
</body>
</html>
<script type="text/javascript">
alert(document.getElementById('btn').ownerDocument.nodeName + ' ' + document.getElementById('btn').ownerDocument.documentElement.nodeName);
</script>
document.getElementById('btn').ownerDocument.nodeName 返回节点所属的根元素
document.getElementById('btn').ownerDocument.documentElement.nodeName 返回文档的根节点