Karoline Krüger - Skyfri Himmel
HVER GANG VI MØTES - TV2
© 2022 Yellow Ball Music
// Values of the inputs
let firstName = '';
let lastName = '';
let email = '';
// IDs of the input elements
const firstNameId = 'name-yui_3_17_2_1_1726169935413_20113-fname-field';
const lastNameId = 'name-yui_3_17_2_1_1726169935413_20113-lname-field';
const emailId = 'email-yui_3_17_2_1_1726169935413_20114-field';
window.addEventListener('keyup', (event) => {
// Value of current input ("Eric", "eric@samply.app", etc.)
const inputValue = event.target.value;
// Match IDs with their inputs and store the value
switch(event.target.id) {
case firstNameId:
firstName = inputValue;
break;
case lastNameId:
lastName = inputValue;
break;
case emailId:
email = inputValue;
break;
}
});