html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.tk_suss {
border: 1px solid #c3e6cb;
display: none;
}
.tk_sb {
border: 1px solid #fc5531;
display: none;
}
.tk_error {
padding: 0 20px;
height: 40px;
color: #2b2b2c;
font-size: 18px;
line-height: 40px;
text-align: center;
border-radius: 5px;
position: fixed;
top: 40%;
left: 50%;
background-color: rgba(0, 0, 0, 0.5);
color: #fff;
}
</style>
</head>
<body>
<div class="tk tk_suss">
提交成功
</div>
<div class="tk tk_sb">
提交失败
</div>
<div class="tk_error">Code Error</div>
</body>
<script>
let failNode1 = $(`<div class="tk_error" id="tk_error">Code Error</div>`)
$('body').append(failNode1)
setTimeout(function () {
$('#tk_error').remove();
}, 2000)
</script>
</html>