How can I get the ID of an element using jQuery?

后端 未结 19 2875
伪装坚强ぢ
伪装坚强ぢ 2020-11-22 11:57

Why doesn\'

19条回答
  •  半阙折子戏
    2020-11-22 12:13

    This can be element id , class , or automatically using even

    ------------------------
    $(this).attr('id');
    =========================
    ------------------------
    $("a.remove[data-id='2']").attr('id');
    =========================
    ------------------------
    $("#abc1'").attr('id');
    =========================
    

提交回复
热议问题