Inline rendering with document​.currentScript

For quick and dirty rendering of simple dynamic content, you may not need the complexity of a templating language like Handlebars or a PHP backend. Let’s use the example phrase, “Come on, it’s <currentYear> ” . It should result in “Come on, it’s 2025 ” when rendered today. You can write this directly in HTML— without IDs, classes, or querySelectors in your JS! Thanks to the document.currentScript…