Clone a node using Javascript DOM
- by Abhimanyu
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?