对于web页面中任何按钮事件都可以产生一个“确认”和“取消”提示框,怎么写呢?
那么这里在脚本中写就方便很多了,eg:
<script type="text/javascript" language="javascript">
    window.document.onclick=doClick;
    function doClick()
    {
    var vid=event.srcElement.id;
    var title = document.getElementById("DataList1_ctl00_lbTitle").innerText;
    if(vid.indexOf('btAgree')!=-1)       //这是对一个ID为btAgree的按钮所产生的一个确认对话框;
    {
     return confirm("你确实要批准"+title+"吗?")
    }
    }
    </script>

//这意味任何具有ID的按钮,都能产生如此效果,很简单也很实用吧

相关文章:

  • 2021-05-23
  • 2022-12-23
  • 2022-12-23
  • 2022-03-05
  • 2022-12-23
  • 2021-10-20
猜你喜欢
  • 2021-06-11
  • 2022-12-23
  • 2022-12-23
  • 2022-02-15
  • 2021-06-26
  • 2021-09-27
  • 2021-11-29
相关资源
相似解决方案