JS - 对话框

1,
<span onclick="return confirmAct();">执行操作</span>

2,

function confirmAct(){   

  if(confirm('确定要执行此操作吗?')){

    alert(1)
  }else{
    alert(2)
  }

}

posted @ 2019-10-08 14:43  武卡卡  阅读(101)  评论(0编辑  收藏  举报