Click table row and get value of all cells

后端 未结 5 944
温柔的废话
温柔的废话 2020-12-31 16:05

I don\'t know JQuery, so I\'m hoping there is a way to do this in pure Javascript.

I need to click on a table row and get the value of each cell in that row. Here i

5条回答
  •  抹茶落季
    2020-12-31 17:08

    $("tr").click(function () {
        var rowItems = $(this).children('td').map(function () {
            return this.innerHTML;
        }).toArray();
    });
    

提交回复
热议问题