javascript - JS get value of generated textnode -


i have javascript in loop:

renderaelements[i] = document.createelement ("a");         renderaelements[i].setattribute("href", "#");         renderaelements[i].setattribute("class", "expander");         renderaelements[i].appendchild(expand);          alert (renderaelements[i].nodevalue); 

where expand created as:

var expand = document.createtextnode("+"); 

the alert, meant return link text of each created element returns null. why this?

because trying nodevalue of element node , not text node.

alert (renderaelements[i].firstchild.nodevalue); 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -