Element IDs are automatically attached to the window object
<script>
document.addEventListener('DOMContentLoaded', () => {
window.thing.innerHTML = 'Hello, World!';
});
</script>
<div id="thing"></div>