Skip to main content
D
JavaScript
JavaScript Output

JavaScript Output

JavaScript outputs data in four different ways.

Read Time
5 min read
Difficulty
Beginner
Last Updated
Jun 15, 2026
Version
v1.0.0

Introduction

JavaScript does not have built-in print functions. Instead, developers output data by altering HTML elements, writing directly to the document, popping up alert boxes, or logging messages to the browser console.

Syntax

Syntax
1/* output syntax */
2console.log("Hello World");
3alert("Hello World");

Key Points

  • `innerHTML` writes into HTML elements.
  • `document.write()` writes to the HTML document.
  • `window.alert()` creates a pop-up box.
  • `console.log()` sends data to the developer tools.

Up Next

Continue your journey with the next topic.

Go to JS Statements