Skip to content

Instantly share code, notes, and snippets.

@desoga10
Created April 9, 2019 12:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save desoga10/8b7fc17cb889ff43490394efd09adff7 to your computer and use it in GitHub Desktop.
Save desoga10/8b7fc17cb889ff43490394efd09adff7 to your computer and use it in GitHub Desktop.
Add data to table
//Add Player To Table
document.querySelector('#player-form').addEventListener('submit', e => {
//Prevent Default Submission
e.preventDefault();
//Get The Values of The Form
const firstname = document.querySelector('#firstname').value;
const lastname = document.querySelector('#lastname').value;
const residence = document.querySelector('#residence').value;
const position = document.querySelector('#position').value;
const country = document.querySelector('#country').value;
const jerseynumber = document.querySelector('#jersey').value;
//Instantiate Player Register Class
const player = new Player(
firstname,
lastname,
residence,
position,
country,
jerseynumber
);
//Register a New Player
Interface.addPlayers(player);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment