📜  vanilla js 点击 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:56.008000             🧑  作者: Mango

代码示例2
var div = document.getElementById('myId');
div.addEventListener('click', function(e){
  console.log(this.getAttribute('id'))
});