这个答案解释了如何获取点击按钮的 ID。
JavaScript - onClick 获取被点击按钮的 ID
但是,您还可以获得该按钮的其他属性吗?例如name或data-* attributes?
name
data-* attributes
javascript
javascript ×1