Passing data to a jQuery click() function

后端 未结 5 2034
独厮守ぢ
独厮守ぢ 2021-01-01 21:21

I have a simple span like so

Remove

This span is within a table, each row has a remo

5条回答
  •  迷失自我
    2021-01-01 22:11

    The following code will get you the ID of the clicked span. Using the ID isn't perfect, but it will work.

    $(".removeAction").click(function() {
      alert($(this).attr("id"));
    });
    

提交回复
热议问题