JavaScript Tutorial

The language for programming web pages.

JS Output

JavaScript Output

JavaScript can display data in different ways depending on the use case.

Output Methods:

  • innerHTML — Write to an HTML element
  • document.write() — Write to HTML document (testing only)
  • window.alert() — Alert box
  • console.log() — Browser console (for debugging)
  • console.error() — Red error in console
  • console.table() — Table in console

Try It Yourself

Edit the code below and click Run to see the result live.

Source Code
Result
Topics