Notes
![]() ![]() Notes - notes.io |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="login-container">
<label for="username">Username:</label>
<input type="text" id="username" required>
<label for="password">Password:</label>
<input type="password" id="password" required>
<button onclick="login()">Login</button>
<p id="loginError" class="error-message"></p>
</div>
<script src="script.js"></script>
</body>
</html>
HOME.HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Student Management System</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div id="main-container">
<div class="class-container" id="class10">
<button onclick="loadStudents(10)">10th Std</h2>
<ul id="studentsList10"></ul>
</div>
<div class="class-container" id="class11">
<button onclick="loadStudents(11)">11th Std</h2>
<ul id="studentsList11"></ul>
</div>
<div class="class-container" id="class12">
<button onclick="loadStudents(12)">12th Std</h2>
<ul id="studentsList12"></ul>
</div>
</div>
<script src="script.js"></script>
</body>
</html>
STYLE.CSS:
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #f4f4f4;
}
.login-container {
max-width: 400px;
margin: 50px auto;
background-color: #fff;
padding: 20px;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.class-container {
max-width: 600px;
margin: 20px auto;
background-color: #fff;
padding: 20px;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
cursor: pointer;
}
.hidden {
display: none;
}
.error-message {
color: red;
}
SCRIPT.JS:
function login() {
const username = document.getElementById('username').value;
const password = document.getElementById('password').value;
// Simple username/password validation (replace with more secure methods in production)
if (username === 'admin' && password === 'password') {
document.getElementById('loginError').innerText = '';
window.location.href = 'home.html'; // Redirect to the home page
} else {
document.getElementById('loginError').innerText = 'Invalid username or password';
}
}
function loadStudents(classNumber) {
// Clear previous student list
const studentsList = document.getElementById('studentsList');
studentsList.innerHTML = '';
// Fetch students from the backend based on class number
fetch(`http://localhost:5000/student/${classNumber}`)
.then(response => response.json())
.then(data => {
// Display students on the home page
data.forEach(student => {
const studentItem = document.createElement('li');
studentItem.innerHTML = `
<strong>ID:</strong> ${student.id} <br>
<strong>Name:</strong> ${student.name} <br>
<strong>Assignment:</strong> ${student.assignment} <br>
<strong>Attendance:</strong> ${student.attendance} <br>
<strong>Contact:</strong> ${student.contact} <br>
`;
studentsList.appendChild(studentItem);
});
})
.catch(error => {
console.error('Error fetching students:', error);
});
}
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team