<div onclick="test()" >点击</div>

function test()

{

  alert('123');

}

 

1. 可以用jQuery触发

2.如果用原生的 js 触发.

  document.getElementById("xxx").click() ;

  这样就可以触发 test() 函数.

相关文章:

  • 2022-12-23
  • 2021-07-29
  • 2022-12-23
  • 2021-07-22
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-20
  • 2022-12-23
  • 2022-01-23
  • 2021-08-31
相关资源
相似解决方案