Course Content
Project file
0/1
Complete Web Designing Course for Beginners

Lesson 6.9 – Mini Project: Interactive Web Page

πŸš€ Building a Complete Interactive Website Using HTML, CSS & JavaScript


🎯 Learning Objectives

After completing this lesson, students will be able to:

βœ… Combine HTML, CSS, and JavaScript

βœ… Use Variables

βœ… Use Functions

βœ… Use Events

βœ… Use DOM Manipulation

βœ… Create Interactive User Interfaces

βœ… Build Real-World JavaScript Projects


πŸ“– Introduction

Congratulations! πŸŽ‰

You have learned:

βœ… Introduction to JavaScript

βœ… Variables & Data Types

βœ… Operators

βœ… Conditional Statements

βœ… Loops

βœ… Functions

βœ… Events

βœ… DOM Manipulation

Now it’s time to combine everything into a complete:

πŸ† Interactive Web Page Project


🌟 Project Overview

We will create:

Student Information Portal

Features:

βœ… Enter Student Name

βœ… Display Welcome Message

βœ… Change Background Color

βœ… Show Student Details

βœ… Interactive Buttons

βœ… DOM Manipulation


🎯 Project Layout

Β 
----------------------------------

Student Information Portal

----------------------------------

Enter Name

[____________]

[ Show Welcome ]

[ Change Color ]

[ Show Details ]

----------------------------------

Output Area

----------------------------------
Β 

πŸ—‚οΈ Project Files

Create:

index.html

style.css

script.js

🎯 Step 1 – Create HTML Structure

index.html

<!DOCTYPE html>

<html>

<head>

<title>Interactive Web Page</title>

<link rel="stylesheet" href="style.css">

</head>

<body>

<h1>

Student Information Portal

</h1>

<input type="text"

id="studentName"

placeholder="Enter Your Name">

<br><br>

<button onclick="showWelcome()">

Show Welcome

</button>

<button onclick="changeColor()">

Change Color

</button>

<button onclick="showDetails()">

Show Details

</button>

<div id="output">

Result Appears Here

</div>

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

</body>

</html>

🎯 Step 2 – Create CSS Design

style.css

body{

font-family:Arial;

text-align:center;

padding:50px;

background:#f5f5f5;

}

h1{

color:#0d6efd;

}

input{

padding:10px;

width:250px;

font-size:16px;

}

button{

padding:10px 20px;

margin:5px;

background:#0d6efd;

color:white;

border:none;

cursor:pointer;

border-radius:5px;

}

button:hover{

background:#084298;

}

#output{

margin-top:30px;

padding:20px;

background:white;

border-radius:10px;

box-shadow:0 0 10px lightgray;

font-size:20px;

}

🎯 Step 3 – Create JavaScript Functions

script.js

function showWelcome()
{

let name =
document.getElementById("studentName").value;

document.getElementById("output").innerHTML =
"Welcome " + name;

}

🌟 Understanding the Code

Get user input:

Β 

document.getElementById("studentName").value
Β 

Display message:

document.getElementById("output").innerHTML

🎯 Step 4 – Change Background Color

Add to:

script.js

function changeColor()
{

document.body.style.backgroundColor =
"lightblue";

}

Output

Click:

Β 
Change Color
Β 

Background becomes:

Β 
Light Blue
Β 

🎯 Step 5 – Show Student Details

Add:

function showDetails()
{

let name =
document.getElementById("studentName").value;

document.getElementById("output").innerHTML =

"Student Name: " + name +

"<br>Branch: Computer Science" +

"<br>College: Government Polytechnic";

}

Output Example

If user enters:

Β 
Rahul
Β 

Display:

Β 
Student Name: Rahul

Branch: Computer Science

College: Government Polytechnic
Β 

🌟 Complete JavaScript Code

script.js

function showWelcome()
{

let name =
document.getElementById("studentName").value;

document.getElementById("output").innerHTML =
"Welcome " + name;

}

function changeColor()
{

document.body.style.backgroundColor =
"lightblue";

}

function showDetails()
{

let name =
document.getElementById("studentName").value;

document.getElementById("output").innerHTML =

"Student Name: " + name +

"<br>Branch: Computer Science" +

"<br>College: Government Polytechnic";

}

🎯 Project Features Used

Concept Used
Variables βœ…
Functions βœ…
Events βœ…
DOM Manipulation βœ…
Input Fields βœ…
Buttons βœ…

🌟 Adding Conditional Statement

Improve Welcome Button:

function showWelcome()
{

let name =
document.getElementById("studentName").value;

if(name == "")
{

document.getElementById("output").innerHTML =
"Please Enter Your Name";

}
else
{

document.getElementById("output").innerHTML =
"Welcome " + name;

}

}

Output

If input is empty:

Β 
Please Enter Your Name
Β 

Otherwise:

Β 
Welcome Rahul
Β 

🎯 Adding Counter Using Variables

HTML

<button onclick="countClick()">

Count Click

</button>

JavaScript

let count = 0;

function countClick()
{

count++;

document.getElementById("output").innerHTML =

"Button Clicked " + count + " Times";

}

Output

First Click:

Β 
Button Clicked 1 Times
Β 

Second Click:

Β 
Button Clicked 2 Times
Β 

🌟 Complete Professional Version

Features:

βœ… Welcome Message

βœ… Student Details

βœ… Input Validation

βœ… Background Color Change

βœ… Click Counter

βœ… Dynamic Output Area


πŸ’» Final Complete Project

index.html

<!DOCTYPE html>

<html>

<head>

<title>Interactive Web Page</title>

<link rel="stylesheet" href="style.css">

</head>

<body>

<h1>

Student Information Portal

</h1>

<input type="text"

id="studentName"

placeholder="Enter Your Name">

<br><br>

<button onclick="showWelcome()">

Show Welcome

</button>

<button onclick="changeColor()">

Change Color

</button>

<button onclick="showDetails()">

Show Details

</button>

<button onclick="countClick()">

Count Click

</button>

<div id="output">

Result Appears Here

</div>

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

</body>

</html>

script.js

let count = 0;

function showWelcome()
{

let name =
document.getElementById("studentName").value;

if(name == "")
{

document.getElementById("output").innerHTML =
"Please Enter Your Name";

}
else
{

document.getElementById("output").innerHTML =
"Welcome " + name;

}

}

function changeColor()
{

document.body.style.backgroundColor =
"lightgreen";

}

function showDetails()
{

let name =
document.getElementById("studentName").value;

document.getElementById("output").innerHTML =

"Student Name: " + name +

"<br>Branch: Computer Science" +

"<br>College: Government Polytechnic";

}

function countClick()
{

count++;

document.getElementById("output").innerHTML =

"Button Clicked " + count + " Times";

}

🎯 Expected Output

User enters:

Β 
Rahul
Β 

Button Click:

Β 
Show Welcome
Β 

Output:

Β 
Welcome Rahul
Β 

Button Click:

Β 
Show Details
Β 

Output:

Β 
Student Name: Rahul

Branch: Computer Science

College: Government Polytechnic
Β 

🏫 Real World Applications

This project demonstrates concepts used in:

βœ… Student Management Systems

βœ… Online Registration Forms

βœ… LMS Platforms

βœ… Attendance Systems

βœ… College Portals

βœ… Dashboard Applications


⚠️ Common Beginner Mistakes

Mistake 1

Wrong ID Name

document.getElementById("name")

HTML:

id="studentName"

IDs must match.


Mistake 2

Missing Function Parentheses

Wrong:

onclick="showWelcome"

Correct:

onclick="showWelcome()"

Mistake 3

Forgetting Script File Link

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

Must be added.


🌟 Best Practices

βœ… Use meaningful function names.

βœ… Validate user input.

βœ… Keep code organized.

βœ… Separate HTML, CSS, and JavaScript files.

βœ… Test every feature.


πŸ† Module 6 Final Project Challenge

Create your own:

Polytechnic Student Portal

Include:

βœ… Student Name

βœ… Roll Number

βœ… Branch

βœ… Semester

βœ… Welcome Message

βœ… Color Changer

βœ… Student Details Viewer


πŸ“ Practical Activity

Create:

College Admission Portal

Features:

  • Name Input
  • Email Input
  • Course Selection
  • Submit Button
  • Success Message

Using JavaScript and DOM Manipulation.


πŸ“‹ Assignment

Assignment 6.9

  1. Which concepts are used in this project?
  2. Why is DOM Manipulation important?
  3. How are Events used?
  4. Why are Functions useful?
  5. Add a Reset Button to the project.
  6. Add another button to change text color.
  7. Modify the project for a College Admission Form.

🧠 Quiz

Q1. Which JavaScript feature changes webpage content?

A. Loop

B. DOM Manipulation

C. Variable

D. Operator

βœ… Answer: B


Q2. Which event is used for button clicks?

A. onload

B. onsubmit

C. onclick

D. onkeyup

βœ… Answer: C


Q3. Which property gets text box data?

A. innerHTML

B. style

C. value

D. src

βœ… Answer: C


Q4. Which keyword creates a function?

A. create

B. define

C. function

D. method

βœ… Answer: C


Q5. This project combines?

A. Events

B. Functions

C. DOM Manipulation

D. All of These

βœ… Answer: D


πŸ“Œ Module 6 Summary

You have successfully learned:

βœ… Lesson 6.1 – Introduction to JavaScript

βœ… Lesson 6.2 – Variables & Data Types

βœ… Lesson 6.3 – Operators

βœ… Lesson 6.4 – Conditional Statements

βœ… Lesson 6.5 – Loops

βœ… Lesson 6.6 – Functions

βœ… Lesson 6.7 – Events

βœ… Lesson 6.8 – DOM Manipulation

βœ… Lesson 6.9 – Mini Project: Interactive Web Page

Scroll to Top