Get the id of a the item that is clicked

前端 未结 10 1866
执念已碎
执念已碎 2020-12-11 09:26

I have this html code:

FOO
FOO2


        
10条回答
  •  悲&欢浪女
    2020-12-11 10:03

    $('.edit').click(function(){
       var theId = $(this).attr('id');
    }
    

    This will get you the ID of anything clicked with a class of .edit

提交回复
热议问题