对话框
1.定义对话框函数
function comfirm_fun(){
}
<body>
<button type="button" onclick="comfirm_fun()">出售装备</button>
2.在函数里面添加选择确认或取消的的按钮
function comfirm_fun(){
var rs = confirm('请确认是否出售装备');
}
<body>
<button type="button" onclick="comfirm_fun()">出售装备</button>
3.填写做出选择后的告示
function comfirm_fun(){
var rs = confirm('请确认是否出售装备');
if(rs){
document.write('你已出售装备')
}else{
document.write('你取消了出售装备')
}
}
<body>
<button type="button" onclick="comfirm_fun()">出售装备</button>