Clone a node using Javascript DOM

Posted by Abhimanyu on Stack Overflow See other posts from Stack Overflow or by Abhimanyu
Published on 2010-04-29T18:46:33Z Indexed on 2010/04/29 18:57 UTC
Read the original article Hit count: 391

Filed under:
|

I want to create a clone for below code using javascript DOM

 var summaryDiv = __createElement("div","sDiv","sDiv"+j);
        summaryDiv.onmouseover = function() {this.setAttribute("style","text-decoration:underline;cursor:pointer;");}
        summaryDiv.onmouseout = function() {this.setAttribute("style","text-decoration:none;");}
        if(browser.isIE) {
            summaryDiv.onclick = new Function("__fc.show_tooltip("+j+",'view_month')");
    } else {
            summaryDiv.setAttribute("onclick", "__fc.show_tooltip("+j+",'view_month',event)");
        }
   someobj.appendChild(summaryDiv);

I m using obj = summaryDiv.cloneNode(true) which is creating node. but onclick event is not getting fire in case of Internet Explorer.can any body help me over it?

© Stack Overflow or respective owner

Related posts about javascript-events

Related posts about dom