fuction hello(){
alert('hello world');
}span=document.createElement("span");
span.id="FT";
span.onclick='hello()';我想要点击时调用hello()方法;
span.innerHTML='hello'; 
span.style.background="yellow";
document.getElementById('T0').appendChild(span);HTML部分是
<div id="T0"></div>就是达到这个效果:
<div id="T0"><span onclick="hello()">hello</span>