<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <div id="status"></div> <input type="button" value="删除" onclick="sureDelete();"> <script> function sureDelete(){ var v = confirm('确认删除吗?'); console.log(v); document.getElementById("status").innerText = '已删除'; setTimeout(function () { document.getElementById('status').innerText='' }, 5000) } </script> </body> </html>