//一般不建议使用,可以在console调试时使用
<input type="button" >
<script>
    btn.onclick=function(){
        console.log('hello');   //结果弹出 --hello
    }
    location.onclick=function(){
        console.log('location');  //无任何输出--因为window自带locaiton属性,此时window的location属性,覆盖了id为location的标签
    }
</script>

相关文章:

  • 2021-10-31
  • 2021-09-06
  • 2021-07-26
  • 2022-12-23
  • 2022-12-23
  • 2021-12-21
  • 2022-12-23
猜你喜欢
  • 2021-05-24
  • 2022-12-23
  • 2022-12-23
  • 2021-05-24
  • 2021-10-11
  • 2022-02-13
相关资源
相似解决方案