When the item is in html. In js, we call it this way:
var a = document.getElementByID('label');
And if an element is created by a function which is written in js, how to call this element? The function that creates the element:
function creatElem() { var parent = document.getElementsByTagName('BODY')[0]; var label = document.createElement('label'); label.id = 'label'; }
The function that needs to call the Label element, which is created by the creatElem()
function (which is specified above):
function label() { var a = (и как переменной "а" присвоить элемент с id = 'label') }
Apply var a = document.getElementByID('label');
we can not.
Thanks for attention.