How to use javascript to change the style of the <div> c opacity: 0 to opacity: 1 10 seconds after the page loads?

  • one
    The question falls into two independent ones: how to change the style of the block and how to do something in N seconds after the page loads. It is not clear that from this you could not do it yourself. In any case, these two questions should be published separately . - Nick Volynkin
  • Mark the question as accepted (a green check mark to the left of the answer), as I understand that it helped you. - Vadim Ovchinnikov
  • 2
    I do not agree with the current reasons for closing: "it is impossible to give a concise answer" (it’s just impossible in any way :)) and in general with the closure of this question. Yes, it is simple, but it has the right to exist IMHO. - Vadim Ovchinnikov
  • If you are given an exhaustive answer, mark it as correct (a daw opposite the selected answer). - Nicolas Chabanovsky

1 answer 1

Timers.
Change CSS property.

 // Создаём функцию, которая запустится при загрузке страницы (function() { // Создаём таймер setTimeout(function() { document.querySelector('span').style.opacity = '1'; // Меняем прозрачность }, 10000); // 10000 мсек = 10 сек })(); 
 span {opacity: 0} 
 <span>Текст</span>