JQuery: Get the parent element id of a clicked element

后端 未结 4 413
鱼传尺愫
鱼传尺愫 2021-01-18 01:38

I have a div like this:

x
4条回答
  •  有刺的猬
    2021-01-18 01:48

    This must work:

    $(".popupCloseClass").click(function (event) 
    {
        var buttonID = $(this).parent().attr('id');
        disablePopup(buttonID);
    });
    

提交回复
热议问题