1、新建一个html文件,命名为test.html。
3、在input标签的onclick事件内编写条件判断,如添加if条件判断,实现当点击按钮时,弹出“确定要提交吗”,如果选择确定,则提示“提交成功”。代码如下: