'Using jquery to show and then hide div - memorygame

I'm trying to create a memory game using html ccs js and jquery. The problem I'm having is that when I'm trying to show the div that states if the answer was correct, the div becomes visible like I want but it won't disappear.

I have tree conditions and the problem occurs with every one of them:

$(".wrong").show(function(){
$(this).hide(1000);
});


Solution 1:[1]

you can use setTimeout function to hide the element.

setTimeout(function () {
                    $(".wrong").hide()
                }, 1000);

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Rajon Tanducar