Answers for "javascript picture delete after time"

0

javascript picture delete after time

function rockImage() {
    const img = document.createElement('img');
    img.src = 'https://via.placeholder.com/100';
    img.setAttribute('width', '100');
    
    const parent = document.getElementById('div');
    parent.appendChild(img);
    
    setTimeout(() => parent.removeChild(img), 3000);
}

rockImage();
Posted by: Guest on December-14-2020

Code answers related to "javascript picture delete after time"

Code answers related to "Javascript"

Browse Popular Code Answers by Language