Skip to content

Learn & Explore

Learn practical technology, programming, IT infrastructure, cybersecurity and real-world experiences.

  • Home
  • Learn
    • IT Fundamentals
      • What Is Information Technology?
      • History and Evolution of Computer Technology
      • Components of an Information Technology System
    • Java
      • Introduction to Java: What It Is & Why Learn It
    • Programming
    • Web Development
    • Networking
    • Cyber Security
    • Database
    • Roadmaps
      • Java Roadmap
  • Resources
    • Technology Pioneers
      • Charles Babbage
      • Ada Lovelace
      • Alan Turing
      • Grace Hopper
      • Tim Berners-Lee
      • Dennis Ritchie
      • Linus Torvalds
    • IT Degrees in Nepal
      • BSc CSIT(TU)
    • Universities
      • Tribhuvan University
      • Kathmandu University
      • Pokhara University
      • Purbanchal University
      • Mid-West University
      • Far Western University
      • Nepal Open University
    • Quotes
  • About
    • Contact
    • Privacy Policy
    • Terms and Conditions
  • Home
  • Web Development
  • First Code in Javascript

First Code in Javascript

Posted on December 29, 2022 By macharaja No Comments on First Code in Javascript
JavaScript, Web Development
console.log("Hello, World!");

To run this program, you will need to have a web browser that supports JavaScript.

  1. Open a text editor and copy the code above into a new file.
  2. Save the file with a .js extension, for example main.js.
  3. Create an HTML file that includes the JavaScript file you just created. You can do this by adding a <script> element to the HTML file and setting the src attribute to the path of the JavaScript file, like this:
<!DOCTYPE html>
<html>
  <head>
    <title>My JavaScript Program</title>
  </head>
  <body>
    <script src="main.js"></script>
  </body>
</html>
  1. Save the HTML file with a .html extension, for example index.html.
  2. Open the HTML file in a web browser.

You should see the text “Hello, World!” printed to the console.

Post navigation

❮ Previous Post: About Cascading Style Sheets (CSS)
Next Post: Selecting Best Web Hosting ❯

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • IT Career Guide for College Students in Nepal: A Complete Roadmap to Success
  • Procedural Programming vs Object-Oriented Programming (POP vs OOP)
  • What is Programming? A Beginner’s Complete Guide
  • Introduction to Object-Oriented Programming (OOP): Concepts, Features, and Benefits
  • Difference Between C and C++

Categories

  • C & C++
  • C#
  • Course
  • CSS
  • Cyber Security
  • Database
  • HTML
  • IT Career
  • IT Degrees
  • IT Degrees in Nepal
  • IT Fundamentals
  • Java
  • JavaScript
  • Microsoft SQL Server
  • My Learnings
  • MySQL
  • Oracle
  • PHP
  • Programming
  • Quotes
  • Technology
  • Technology Pioneers
  • Universities
  • Web Development
  • Web Hosting

Copyright ©2026