Using an event listener on the button might be more effective?
e.g.
const userName = document.getElementById('github-user-name');
const button = document.getElementById('submit-button');
let index;
button.addEventListener('click',function(e) {
e.preventDefault()
let name = userName.value.toLowerCase()
let sum = 0;
for (let i = 0; i < name.length; i++) {
let code = name.charCodeAt(i);
sum += code;
}
index = sum % 25;
makeRequest(hpObjUrl, hpNameCallback);
})
Using an event listener on the button might be more effective?
e.g.