Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
$(".layui-tab").on("click",function(e){
IF ($ (e.target) .is (. "layui-Close-Tab")) {the console.log ($ (e.target) .parent (). attr ( "Lay-ID")) // output which tab has been clicked, no value is returned when undefined
}
})