I have found two different ways to add a span element to the DOM, but I am unsure which is better to use in terms of best practices and performance.
const letterEl = document.createElement('span')
letterEl.textContent = letter
textEl.appendChild(letterEl)
OR
textEl.innerHTML += '<span>' + letter + '</span>'
textEl is a h1 element that will hold the span
letter is a string value