1、 OnClientClick="return confirm('确定要删除吗?') 

 

2、自定义函数:

  函数:

    <script type ="text/javascript">
        function confirmDemo() {
            if (confirm('是否删除?')) {
                alert('删除成功!');
            } else {
                alert('删除取消!');
            }
        }
    </script>

  调用:

  <input type="button" value="测试" onclick="confirmDemo()" /> 

  效果:

JS - 提示是否删除

相关文章:

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