For a given Text node in the DOM, one can use one of these properties to retrieve its text:
textContent
data
nodeValue
wholeText
But which one to use? Which one is the most reliable and cross-browser supported?
(If multiple properties are 100% reliable and cross-browser, then which one would be most appropriate?)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…