Getting value from table cell in JavaScript…not jQuery

后端 未结 12 1119
后悔当初
后悔当初 2020-12-02 18:19

I can\'t believe how long this has taken me but I can\'t seem to figure out how to extract a cell value from an HTML table as I iterate through the table with JavaScript. I

12条回答
  •  萌比男神i
    2020-12-02 18:53

    Try this out: alert(col.firstChild.data)

    Check this out for the difference between nodeValue and data: When working with text nodes should I use the "data", "nodeValue", "textContent" or "wholeText" field?

提交回复
热议问题