I have a textbox. On focus I call a javascript function in which I create a new element with this way:
var label = document.createElement("label");
label.innerHTML = "*For a more secure password use letters and digits";
document.getElementById('picturediv').appendChild(label);
But onblur I call another function and then I want to remove this element. I’ve tried with the remove but it is not working. I am not sure if the remove is suitable for that.
You can remove it this way:
edit:
The function with comments:
edit because of comment:
to delete label 1:
removeLabel('picturediv');to delete label 2:removeLabel('picturediv2');