先上代码
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>无标题文档</title>
<script type="text/javascript">
var tips={
bgColor:"#ffc",

panel:null,

tid:null,

init:function(tid,content,width,height,x,y){
tips.create(tid,content,width,height,x,y);

document.body.appendChild(tips.panel);

return tips.panel;
},

create:function(tid,content,width,height,x,y){
var div=document.createElement('div');
tips.panel=div;

div.id=tid;
tips.tid=tid;

div.style.width=width+"px";
div.style.height=height+"px";
div.style.border="#000 1px solid";
div.style.backgroundColor=tips.bgColor;
div.style.position="absolute";
div.style.top=y+"px";
div.style.left=x+"px";
div.style.padding="2px";
div.style.color="#000";
div.style.fontSize="14px";
div.style.overflow="hidden";

div.innerHTML=content;

div.onclick=tips.del();
},

del:function(){
alert("It happens!");
document.body.removeChild(tips.panel);
}
}
function test() {
var tipInstance=new Function();
tipInstance.prototype=tips;

tip=new tipInstance();

var content="just for test!"

tip.init("ggt",content,294,94,200,200);

}
</script>
</head><body>
<input type="button" value="test" onClick="test()" />
</body>
</html>本意是想点击按钮,会出来一个js创建的div,显示一些提示信息,然后点击这个创建出来的div时,可以关闭它。
测试结果却是,没有点击这个DIV的时候它就自己执行了del。
反复修改测试了,都没得到想要的效果,包括使用jquery的bind,都不行。请教各位高手,大牛,寻求解决之道。