JavaScript Integration in Student
Registration Page
Introduction
This document explains the basic JavaScript integration in a simple HTML and CSS-based
Student Registration System. The purpose is to demonstrate the understanding of
JavaScript fundamentals like alert boxes, event handling, and console logging.
Purpose of JavaScript in the Project
The JavaScript code added in the registration page is meant to:
1. Show a welcome message when the page loads.
2. Prevent the default form submission.
3. Collect user inputs from the form.
4. Log the inputs into the browser console.
5. Display a confirmation message after submission.
JavaScript Code Explanation
The following JavaScript was added at the end of the <body> section:
<script>
alert("Welcome to the Registration Page!");
[Link]("DOMContentLoaded", function () {
var form = [Link]("registrationForm");
[Link]("submit", function (event) {
[Link]();
var name = [Link]("fullName").value;
var email = [Link]("email").value;
var course = [Link]("course").value;
[Link]("Name: " + name);
[Link]("Email: " + email);
[Link]("Course: " + course);
alert("Registration submitted successfully!");
});
});
</script>
Conclusion
This JavaScript addition follows beginner-level coding practices as introduced in class. It
enhances user experience by showing alerts and logging the data for testing purposes
without any advanced functionality.