How to show code output in text?

What whisky said, but also:
document.write and show() are completely different things.

.show(); is the Corvid equivalent to .style.visibility = ‘visible’;

Anything after double slashes is just a comment intended for humans - it is not read by the computer. //const id… does nothing

Use let instead of var . You can find plenty of resources on what the difference is if you want, but it’s just better practice.

$w is a selector , thus is used exclusively for front-end. Backend = server functions, and the server only delivers/receives data, it cannot read page elements.