function firstToUpper(inputName) {
var input = document.getElementById(inputName);
input.value = input.value.charAt(0).toUpperCase() + input.value.slice(1);
}
document.getElementById('button').addEventListener('click',() => firstToUpper('input'));