Get a particular cell value from HTML table using JavaScript

前端 未结 10 960
暖寄归人
暖寄归人 2020-12-15 06:09

I want to get each cell value from an HTML table using JavaScript when pressing submit button.

How to get HTML table cell values?

10条回答
  •  伪装坚强ぢ
    2020-12-15 06:36

    To get the text from this cell-

    some text

    You can use this -

    var Row = document.getElementById("somerow");
    var Cells = Row.getElementsByTagName("td");
    alert(Cells[0].innerText);
    

提交回复
热议问题