Uncaught TypeError: Cannot read property 'parentNode' of null javascript -


this code should make element disappear list when dropped on element (called cookiemonster)

addevent(cookiemonster, 'drop', function (e) {   if (e.stoppropagation) e.stoppropagation();    var el = document.getelementbyid(e.datatransfer.getdata('text'));   el.parentnode.removechild(el);   return false; }); 

create auxiliar variable this

addevent(cookiemonster, 'drop', function (e) {     if (e.stoppropagation) e.stoppropagation();      var el = document.getelementbyid(e.datatransfer.getdata('text'));     var aux = el.parentnode;     aux.removechild(el);     return false; }); 

Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -