this指触发事件的对象 

代码如下:

<input />

 

代码如下:

function test(obj){ 
alert(obj); //[object HTMLInputElement] 
alert(obj.id); //myinput 
alert(obj.value); //javascript中onclick中的this 
}

相关文章:

  • 2022-12-23
  • 2022-01-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-03
  • 2021-12-05
  • 2021-08-29
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-18
  • 2021-10-11
  • 2021-11-07
  • 2021-06-10
相关资源
相似解决方案