javascript:void(0)用法如下:

<a href="javascript:void(0)"></a> // 执行js函数,0表示不执行函数。
<a href="javascript:void func()"><button type="button">点我</button></a> // 执行函数func,括号里可以传参数。
<script type="javascript/text">
$(
function func() {
console.log("ok")
}
)
</script>

 

相关文章:

  • 2022-01-02
  • 2021-09-05
  • 2022-12-23
  • 2021-06-23
  • 2022-12-23
  • 2021-12-17
猜你喜欢
  • 2021-10-06
  • 2021-09-24
  • 2022-12-23
  • 2021-12-10
  • 2021-10-18
相关资源
相似解决方案