JavaScript can change HTML content.
JavaScript can hide HTML elements.
A Paragraph. (element named 'demo5' in html).
Java Demo 6 External File Scripts
Now testing java outputs. using code bit from here https://www.w3schools.com/js/js_examples.asp
Never call document.write after the document has finished loading adding 5 + 6. It will overwrite the whole document.
Then using a defined page element 'demo9' which is initially blank and we use document.getElementById("demo9").innerHTML to reference it and the '=' to apply out output
Then we can do the same using windows.alert which is the popup that you saw as you opened the page
Alternatively console.log could be used which would put output into a browser debug location needing F12 to access it and select 'Console' at the top of the panel that opens to see debug output.
This page and the java6 page linked with its external script file take the tutorial as far as syntax learning pages
Here