Hide Element after Seconds with jQuery

<script>setTimeout(function() {
    $('#snippet').fadeOut('fast');
}, 1000); // <-- time in milliseconds
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<style>#snippet{
    width: 100px;
    height: 100px;
    background: #000;
    color: #fff;
    text-align: center;
}</style>

Leave a Reply