function test(e) { $(e.target).attr('id') } // 记得带上点击事件 转载于:https://www.cnblogs.com/aaronthon/p/10883353.html