To get a value of a TD using JQuery

前端 未结 4 603
予麋鹿
予麋鹿 2021-01-12 05:32

I got a very simple Table with only two rows.
I was thinking what is the best way to get the value from the TD with ID \"row2\".

4条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-12 06:09

    Use text() instead of val()

    var r = $("#row2").text();
    

    More Info:

    • .text()

提交回复
热议问题