How to use javascript to change the style of the <div> c opacity: 0 to opacity: 1 10 seconds after the page loads?
- oneThe 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
- 2I 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
// Создаём функцию, которая запустится при загрузке страницы (function() { // Создаём таймер setTimeout(function() { document.querySelector('span').style.opacity = '1'; // Меняем прозрачность }, 10000); // 10000 мсек = 10 сек })(); span {opacity: 0} <span>Текст</span> - oneThank you so much, all the Internet has climbed and found nothing. - TarakaN27
- @Other, let's continue in my chat: chat.stackexchange.com/rooms/52027/communication-with-the-yuri - Yuri
|