How to get a table cell value using jQuery?

后端 未结 9 1141
终归单人心
终归单人心 2020-11-22 14:41

I am trying to work out how to get the value of table cell for each row using jQuery.

My table looks like this:

9条回答
  •  醉梦人生
    2020-11-22 15:33

    Try this,

    $(document).ready(function(){
    $(".items").delegate("tr.classname", "click", function(data){
                alert(data.target.innerHTML);//this will show the inner html
        alert($(this).find('td:eq(0)').html());//this will alert the value in the 1st column.
        });
    });
    

提交回复
热议问题