Getting Started with JavaScript – Build Your First Interactive Web Page

March 3, 20261 minute read

farhaan

farhaan

Instructor

Getting Started with JavaScript – Build Your First Interactive Web Page

💡 What You’ll Build

A simple button that changes text when clicked.

🧱 HTML Structure

<!DOCTYPE html>
<html>
<head>
  <title>My First JS Project</title>
</head>
<body>

  <h1 id="title">Hello Developer 👋</h1>
  <button onclick="changeText()">Click Me</button>

  <script src="script.js"></script>
</body>
</html>

⚡ JavaScript Logic (script.js)

function changeText() {
  document.getElementById("title").innerText = "You clicked the button 🚀";
}

✅ You just built your first interactive webpage!

© 2026 Softcamper. All rights reserved.