JavaScript Output
JavaScript Output specifies how to display the results of a given code. The result can be shown in four distinct ways, as detailed below:
1. innerHTML:
It is used to access an element. It defines the HTML content.
Syntax
2. document.write():
It is used for testing purposes.
Syntax
3. window.alert():
It displays the content using an alert box.
Syntax
4. console.log():
It is used for debugging purposes.