Get Anchor tag class/id from table jQuery

This question already has an answer here:

  • How to get the id of an anchor tag in jQuery? 2 answers

  • use

    For getting class name

    $(".kimztableclass a").attr("class");
    

    For getting Id

    $(".kimztableclass a").attr("id");
    

    For getting text

    $(".kimztableclass a").text();
    

    使用attr()方法

    $('.mytableanchortagclass tr').find('a').attr('id')
    

    这将返回类kimzanchorclass所有锚标记:

    $('a.kimzanchorclass').attr('id');
    
    链接地址: http://www.djcxy.com/p/83304.html

    上一篇: 如何找到鼠标点击jQuery中的div ID?

    下一篇: 从表jQuery获取锚标记类/标识