JavaScript can "display" data in different ways:
innerHTML.document.write().window.alert().console.log().To access an HTML element, JavaScript can use the document.getElementById(id) method.
The id attribute defines the HTML element. The innerHTML property defines the HTML content
For testing purposes, it is convenient to use document.write():
You can use an alert box to display data
For debugging purposes, you can call the console.log() method in the browser to display data
JavaScript does not have any print object or print methods.
You cannot access output devices from JavaScript.
The only exception is that you can call the window.print() method in the browser to print the content of the current window
Aenean lorem odio, mollis sed consequat et, pellentesque id purus. Nunc sagittis malesuada urna, ultricies lacinia nisi varius vitae. Aliquam sit amet egestas sapien, nec mollis quam.