Remove parent div by class name - jquery

前端 未结 5 1590
别那么骄傲
别那么骄傲 2021-01-14 20:58

I have a remove link that will remove the current comment on my page. It uses ajax to change the database and upon success, I want to remove the div the comment resides in.

5条回答
  •  梦谈多话
    2021-01-14 21:53

    You'd be better off tackling this by setting an ID for the comment in your code.

    For example:

    Then using this ID with your AJAX request and response.

    A little more work, but it's more robust (IMO)

提交回复
热议问题