JS+DIV延时几秒后消失或显示代码
<script>functionoperate(){document.getElementById('div_test').style.display="";setTimeout("disappeare()",2000);}functiondisappeare(){document.getElementById('div_test').style.display="none";}</script></head><body><inputtype="button"onclick="javascript:operate()"value="操作"/><divid="div_test"style="display:none;color:white;line-height:25px;position:absolute;z-index:100;left:50%;top:2%;margin-left:-75px;text-align:center;width:150px;height:25px;font-size:12px;">恭喜你,操作成功!</div>。
2020/1/1