JavaScript Practice Example #1 - Print Hello World in JavaScript in Browser Console

Algorithm


Output any element in JavaScript is simple.

There is many more approaches to print something in browser using JavaScript.

  1. Print something in browser console -
    1. console.log("Hello World")
  2. Print Something on document body
    1. document.write("Hello World")
  3. Print something on DOM
    1. document.getElementById('test').innerHTML = "Hello World"

Code Examples

#1 Code Example with Javascript Programming

Code - Javascript Programming


console.log("Hello World");
Copy The Code & Try With Live Editor

Demonstration


JavaScript Practice Example #1 - Print Hello World in JavaScript in Browser Console

Previous
JavaScript Practice Examples #0 - Examples at a glance - Practice All Javascript problems
Next
JavaScript Practice Example #2 - Assign Variable and Introducing Javascript data types