jquery: get id from class selector

前端 未结 7 1298
离开以前
离开以前 2020-12-23 09:22

Is there any way that I can get the id of an element from something like:

Some text


        
相关标签:
7条回答
  • 2020-12-23 09:54
    $(".class").click(function(){
        alert($(this).attr('id'));
    });
    

    only on jquery button click we can do this class should be written there

    0 讨论(0)
提交回复
热议问题