Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
コールバック関数「OnSuccess」で、クリックした要素を取得できません。「Del」ボタンをクリックした後、クリックした「Del」ボタンの「tr」要素を削除しようとしました。これを行う方法は?
の組み合わせを使用し$(this)て、ボタン (またはそれをトリガーした他の dom 要素) を取得します。
$(this)
次に.closest、trパラメーターを使用して行を取得します。
.closest
tr
続いて.removeそれを削除します:
.remove
$(this).closest('tr').remove();