javascript - Why can't I bind events to the elements in a namespace? -


i have following code , want listen mouseclick event nothing happen in case why?

function obj(tag){   this.el = document.createelementns("http://www.w3.org/1998/math/mathml",tag);   this.el.appendchild(document.createtextnode("cccc"));   this.el.onclick = function(){     alert("onclick");   } } var x = new obj("mi"); document.body.appendchild(x.el); 


Comments