JQuery教程:绑定事件

说明

详见链接:
https://www.runoob.com/jquery/event-on.html

所有事件:
https://www.runoob.com/jquery/jquery-ref-events.html

例子

$("#deptTable").on("click","button[data-type='modify']",{},function (e) {
    let $btn = $(e.target)
    let dataId = $btn.attr("data-id")
    location.href="dept_show.html?id="+dataId
})

原文出处:https://www.malaoshi.top/show_1IX42t1NRCQ1.html