---
title: "body.appendChild的方法"
author: "cyz001"
date: "2009-09-22T15:38:19Z"
tags: []
slug: "body-appendchild"
draft: false
lastmod: "2009-09-22T15:38:19Z"
id: 474271
url: "https://cyz001.iteye.com/blog/474271"
---

```js

<script>
(function(){
	this.div = document.createElement("div");
	this.div.innerHTML = "never-online";
	document.body.appendChild(div); 
	this.div.onclick = function(){
		alert(this.tagName);
	}
}
)()
</script>
<body>hello</body>

```