点击按钮出现提示框三秒,三秒后消失
.prompt{
display: none;
padding:20px;
position: fixed;
top: 40%; left:40%;
border-radius:5px;
background: rgba(0,0,0,0.4);
z-index: 5000;
color:#FFF;
}
<button class="btn">alert</button>
<p class="prompt">Submission of success</p>
$ (function (){
$ ('.btn').click (function (){
$ ('.prompt').show().delay(1000).fadeOut();
});
});