<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<link rel="stylesheet" href="">

</head>
<body>
<ul ,function(e){
console.log(e);
// this 是当前点击的元素
alert(this.name);
alert(this.getAttribute('data-age'));
console.log(this.dataset['age']);
})
}
</script>
</body>
</html>

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-28
  • 2022-01-11
  • 2021-07-30
  • 2021-12-01
  • 2022-01-27
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-07
  • 2021-08-02
  • 2022-02-08
  • 2021-08-12
相关资源
相似解决方案