Displaying Output
Displaying output or generating output in JavaScript is very important expecially when learning the language
For example, if you want to see if your JavaScript statements or code blocks are correct, you can output data to check
In JavaScript, there are 4 ways of displaying output:
Writing to HTML Elements
By using the innerHTML
property, we can change the content or text of the selected element.
We can use the document.getElementById()
function to select an element