document.addEventListener('DOMContentLoaded', function () { const articleElement = document.querySelector('[wws-lecture-time="article"]'); if (articleElement) { const wordCount = articleElement.innerText.split(/\s+/).length; const readingTime = Math.ceil(wordCount / 200); const timeElement = document.querySelector('[wws-lecture-time="time-text"]'); if (timeElement) { timeElement.innerText = readingTime + ' min'; } else { console.error('Element with wws-lecture-time="time-text" not found'); } } else { console.error('Element with wws-lecture-time="article" not found'); } });