Q:

How to generate a random letter when clicking a button in js

How can I make a button with js that shows a random letter when I click it.

A:

Use Math.random method along with String.fromCharCode method.

console.log(
  String.fromCharCode(
    Math.floor(Math.random() * 26) + 97
  )
)

