Getting value from table cell in JavaScript…not jQuery

后端 未结 12 1132
后悔当初
后悔当初 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条回答
  •  日久生厌
    2020-12-02 18:57

    Have you tried innerHTML?

    I'd be inclined to use getElementsByTagName() to find the elements, and then on each to call it again to find the elements. To get the contents, you can either use innerHTML or the appropriate (browser-specific) variation on innerText.

提交回复
热议问题