Wednesday, 18 September 2013

Cannot remove DOM Element (JavaScript, CreateJS)

Cannot remove DOM Element (JavaScript, CreateJS)

I have a problem removing a DOMElement from the stage. This is how I
created my domElement with createjs Framework.
this.domElement = new
createjs.DOMElement(document.getElementById('nickname'));
this.domElement.x = 580;
this.domElement.y = 200;
this.stage.addChild(this.domElement);
My HTMl code looks like this:
<form id="myForm" style="visibility: hidden">
<input id="nickname" value="" size="10">
Everything works fine till I want to remove "domElement" from the stage.
Here is how I attempted it:
this.stage.removeChild(this.domElement);
I also tried other solutions like :
this.stage.parentNode.removeChild(this.domElement);
Do you have an ideea why I am not able to remove this DOM Element?
Thank you in advance for your help

No comments:

Post a Comment