用attachEvent可以么?
===================================================================
SyntaxbSuccess = object.attachEvent(sEvent, fpNotify)ParameterssEvent Required. String that specifies any of the standard DHTML events. 
fpNotify Required. Pointer that specifies the function to be called when sEvent fires. Return ValueBoolean. Returns true if the function is bound successfully to the event, or false otherwise.

解决方案 »

  1.   

    <script>
    var oE=document.createElement("<div>imafool comming.</div>");
    oE.onclick=function(){alert(this.innerText);};
    document.body.appendChild(oE);
    </script>
      

  2.   

    var oEl=document.createElement("DIV");
    oEl.innerHTML=XXXXX
    oEl.attechEvent("onclick",fun);
    document.body.appendChild(oEl);
      

  3.   

    <script>
       var Obj=document.createElement("DIV");
       Obj.onmouseover="MouseOverEvent()";
       Obj.onmouseout="MouseOutEvent()";
       document.body.appendChild(Obj);
    function MouseOverEvent()
    {
    }
    function MouseOutEvent()
    {
    }
    </script>