JavaScript: Bringing Pages to Life
Β· 2 min read
JavaScript: Bringing Pages to Lifeβ
JavaScript adds logic and interaction.
Exampleβ
<button onclick="sayHello()">Click Me</button>
<script>
function sayHello() {
alert('Welcome to Frontend Development!');
}
</script>
π§ͺ Exerciseβ
-
Create a button
-
On click:
- Change text on the page
- OR show todayβs date
β Goal: Understand events and functions
π Taskβ
Build a simple To-Do list using JavaScript.
The application should allow users to manage daily tasks using a basic web interface.

β Requirementsβ
- An input field to type a task
- A button to add the task
- A list to display all added tasks
π§ͺ Exercisesβ
Exercise 1: Add a Taskβ
- Allow the user to enter a task
- Add the task to the list when the button is clicked
Exercise 2: Prevent Empty Tasksβ
- Do not allow empty tasks to be added
- Show a message if the input is empty
Exercise 3: Remove a Taskβ
- Each task should have a delete option
- Clicking delete should remove the task from the list
Exercise 4: Mark Task as Completedβ
- Clicking a task should mark it as completed
- Completed tasks should look visually different
Exercise 5: Add Task Using Keyboardβ
- Allow the user to add a task by pressing the Enter key
Exercise 6: Show Task Countβ
- Display the total number of tasks
- Update the count when tasks are added or removed
π― Goalβ
Complete this exercise using plain JavaScript (no frameworks).
If you can finish all tasks, you are ready to:
- Build a React To-Do app
- Manage state in frontend frameworks
- Handle real user interactions
If you want to learn other concepts in JavaScript, below is the link from MDN.
MDN JavaScript Tutorials β structured from beginner basics to advanced topics, with examples and explanations. JavaScript guide (MDN) https://developer.mozilla.org/en-US/docs/Web/JavaScript