Javascript nodeValue returns null

后端 未结 3 986
生来不讨喜
生来不讨喜 2021-01-04 19:15

Title should make my problem well described.Here goes my code.

Some text
3条回答
  •  失恋的感觉
    2021-01-04 19:29

    You are missing a firstChild:

    alert(document.getElementById("adiv").firstChild.firstChild.nodeValue);
    

    (I know it sounds weird but this is how text nodes work)

提交回复
热议问题