How do I remove an image a certain amount of time after its been created in Javascript? : <p>I'm trying to make an image disappear after like 2 seconds but I don't know how to do it.</p>

<p>I've looked online but haven't really found anything useful.</p>

<pre><code>function rockImage() {
    var img = document.createElement("img");
    img.src = "rock.png";
    var src = document.getElementById("compChoiceImage");
    img.setAttribute("width", "100");
    src.appendChild(img);
}
</code></pre>

<p>That's the function to create the image I want to add the timer thing into the function.</p>
