Get second td of tr using jquery

后端 未结 5 2158
攒了一身酷
攒了一身酷 2021-02-12 10:54

I\'m trying to get td values of tr.. but unfortunately it\'s not working.. may be there is something wrong

My html looks like

         


        
5条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-12 11:13

    You're already filtering on the tr by its class name, so there's no need to find by tr again.

    jQuery(".dname").find("td:eq(1)").text()
    

    Also, you need to .text() to get the contents of a not .val().

    JSBin here.

    Hope this helps :)

提交回复
热议问题