use
Why using document.write is a bad idea in JavaScript
Why is using document.write a bad idea in JavaScript? Well, document.write is great for debugging or helping you know what a variable is equal to at a certain part in your code. It’s not a good idea to use on an actual web page especially …