Tuesday, 17 September 2013

How to know if an element, created dynamically, exist?

How to know if an element, created dynamically, exist?

I have this simple function:
var x = document.createTextNode("ERROR");
document.body.appendChild(x);
So then I need to create an IF to verify if this message exist [If this
message has been created]. This is the problem, I don't know how to do
that.
GetElementByID seems to don't work with element created by dynamically.
Any help? Thanks.

No comments:

Post a Comment