I need to run the loading screen for 10 seconds and then remove it. And I also tried with setTimeOut but it's not working as I needed. I searched for many tutorials and they only teach how to add a loading animation until the page loads. Please show me the way seniors
const loading = document.querySelector(".loader");
window.addEventListener('load', function() {
loading.style.display = "none";
});
.loader-wrapper {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
color: white;
background-color: #242f3f;
display: flex;
justify-content: center;
align-items: center;
z-index: 4;
}
<div class="loader">Loading...</div>
<div class="content">content</div>