Last active
November 3, 2025 01:49
-
-
Save baslie/1ac47ea08d31835a8c24ccdce335256d to your computer and use it in GitHub Desktop.
Меняем год в копирайте в блоке с классом "uc-copyright" (Тильда)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- ********************************************************************** --> | |
| <!-- Меняем год в копирайте в блоке с классом "uc-copyright" (Тильда) --> | |
| <!-- ********************************************************************** --> | |
| <script> | |
| document.addEventListener('DOMContentLoaded', () => { | |
| const startYear = '2014'; | |
| const className = 'uc-copyright'; | |
| const currentYear = new Date().getFullYear(); // Получаем текущий год | |
| // Находим элемент <strong> внутри заданного класса | |
| const copyrightElement = document.querySelector(`.${className} strong`); | |
| // Если элемент найден, обновляем его содержимое и стиль | |
| if (copyrightElement) { | |
| copyrightElement.innerHTML = `© ${startYear}–${currentYear}`; | |
| copyrightElement.style.fontWeight = '300'; | |
| } | |
| }); | |
| </script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment