ArturK. ArturK. - 21 days ago 6
Javascript Question

Jquery showing and deleting message

.newsUpdateComplited{
height: auto;
background-color: #C5FFB2;
border:1px solid black;
margin-left:5px;
margin-right:5px;
margin-top:10px;
border-radius: 5px;
padding:3px;
visibility:hidden;


This is my css
I would like to show it and after few sec delate it.
How to do it. I was looking for some tutorials but I didn't find anything good.
Can anybody help me please

Answer

You could just set a timer on it. This would be 4 seconds.

$('.newsUpdatedComplited').show();
setTimeout($('.newsUpdatedComplited').hide(), 4000);

You may need to change the visibility:hidden; to be display:none instead.