a标签里写javascript有bug,当写标签内容为函数时,里头获取的this指代的是window

<a class="add delete" href="javascript:;" onclick="deleteLink(this)">删除</a>

function deleteLink(_self){

console.log($(_self));

}

相关文章:

  • 2022-12-23
  • 2021-11-28
  • 2022-12-23
  • 2022-12-23
  • 2021-05-30
  • 2021-09-06
猜你喜欢
  • 2022-12-23
  • 2021-11-09
  • 2022-12-23
  • 2022-12-23
  • 2021-08-21
  • 2022-12-23
  • 2022-03-05
相关资源
相似解决方案