-
-
Save midokhorshed/33fd6736ea5cc576956e9ccafab1ffd3 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