Turn back bricks in memory game
<p>I'm making a memory game and i have generated a table with cards and you can click in them so they turn around with different images. Now i want to turn them back after some second or something. I guess i should use setTimeOut but i dont know how.</p>

<p><strong>Some of my code so far:</strong></p>

<pre><code>turnBrick: function(link, img, pic) {

        link.onclick = function(e) {

            if(img.getAttribute("src") == "pics/0.png") {
                img.setAttribute("src", "pics/" + Memory.arrayRandom[pic - 1] + ".png");


            }

        }
    }
</code></pre>

<p>Note: link is the brick clicked, img i just to check if not clicked and pic is in what order the method is run (like first time, or second time etc.)</p>
