form中submit提交,点击删除增加提示
原来
<input s type="submit" id="btndelete" name="confirm" value="删除" >
更改
<input type="button" id="btndelete" name="confirm" value="删除" onclick="del()" >
<script>
function del() {
//console.log($("#btndelete").val());
if (!confirm('确认要删除吗?')) {
return false;
}
else {
$("#btndelete").prop("type","submit");
}
}
</script>