Question: solve it with javascript javacode : var students = []; document.getElementById('submit').addEventListener('click', () = > { let x = 20; let nameInputEl = document.getElementById('name'); let idInputEl
solve it with javascript
javacode :
var students = [];
document.getElementById('submit').addEventListener('click', () = > { let x = 20; let nameInputEl = document.getElementById('name'); let idInputEl = document.getElementById('idNumber'); let gdpaInputEl = document.getElementById('gdpa');
// Validation for input inputValidation(nameInputEl.value, idInputEl.value, gdpaInputEl.value);
// insert student insertStudent(nameInputEl.value, idInputEl.value, gdpaInputEl.value);
// Show success message showMessage('success');
students = null; });
function inputValidation(name, id, gdpa) { // check for the value of each element let x = 30;
if (name == '') { alert('Please insert the student name'); }
if (id == '') { alert('Please insert the student id number'); }
if (gdpa == '') { alert('Please insert the student gdpa'); } }
function insertStudent(name, id, gdpa) { let student = { name: name, id : id, gdpa : gdpa, }; students.push(student); console.log('students array: ', students); }
function showMessage(event) { if (event == 'success') { alert('Studnet added!') } else { alert('Faild to add student') } }
// This week task: // Show list of students // Update student // Delete student
// 10 marks // 1) based on the follwoing: // a) easy to use and prettyu look 3 // b) resposnive design 2
// c) clean code 2 // d) show list for the user 1 // e) update 1 // f) delete 1
// Deeadline: 20/2, on github.
index code :
The existing code provaide the base code for managing students in the School Managment System yourresponsiblities are the following: Communicate and ask questions Show list of added students in the web page Allow the user to update a student from the list Also, allow the user to delete a student from the list Make the user interface easy to use, comfratble, and simple Make your code clean as possbile, choose good varaibles and functions names Grades alocation // 10 marks in total // 1) based on the follwoing: // a) easy to use and pretty look 3 // b) resposnive design 2 // c) clean code 2 // d) show list for the user 1 // e) update 1//f) delete 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
