Use JavaScript confirm()
function.
<input type="submit" onclick="return confirm('Are you sure?')">
If the user chooses Yes, it will return true
and the button's default action (submitting the form) will continue as usual. But if the user chooses No, it will return false
and the button's default action will be blocked.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…