Start JavaScript in a browser. Browser JavaScript has access to the document and browser APIs; Node.js is a separate runtime used for terminal and server programs.
What you need
- A browser with Developer Tools
- A code editor
- index.html and app.js in the same folder
Set up your environment
- Create
index.htmlwith a paragraph and<script src="app.js" defer></script>in its head. - Save the example as
app.js. - Open the HTML file, open Developer Tools and select Console.
- Edit the message, save the file and reload the HTML page. No Node.js installation is needed for this browser example.
Your first check
Save as app.js
const message = 'Hello from w1coding.com';
console.log(message);
document.querySelector('p').textContent = message;Run or verify
Open index.html and inspect Developer Tools > Console.Expected result: The paragraph and the console both display Hello from w1coding.com.
Common setup problems
- If
documentis undefined, you ran browser code in a non-browser environment. - If the paragraph is null, include a paragraph in the HTML and use the defer attribute so the document is ready.
Official documentation
Guide reviewed 17 November 2026. Check the linked vendor documentation for current supported versions and operating systems.