1、设置 data-x ="y"

在事件处理函数中有个参数 e

e.currentevent.dataset.x可以得到y

2、设置id属性 id = “y”

在事件处理函数中有个参数 e

e.currentevent.id可以得到y

 

相关文章: