I am trying to print out my result using 'innerHTML'
if (userChoice === computerChoice) {
console.log("Tie!");
result_h3.innerHTML =
userChoice + " and " +
computerChoice +
" are both the same. It's a draw!";
How can I make the first letter of the userChoice variable come out in capital on the browser?
I tried:
if (userChoice === computerChoice) {
console.log("Tie!");
result_h3.innerHTML =
userChoice.value.charAt(0).toUpperCase() +
userChoice.value.slice(1).toLowerCase() +
+" and " +
computerChoice +
" are both the same. It's a draw!";
It didn't work.