JSFiddle - React, Tailwind, and code Playground

HTML

<span>The quick brown fox jumps over the lazy dog The quick brown fox jumps over the lazy dogThe quick brown fox jumps over the lazy dogThe quick brown fox jumps over the lazy dogThe quick brown fox jumps over the lazy dogThe quick brown fox jumps over the lazy dogThe quick brown fox jumps over the lazy dogThe quick brown fox jumps over the lazy dogThe quick brown fox jumps over the lazy dog</span>

CoffeeScript

$(document).ready ->
  container = $('span')
  replacement_container_text = ''
  $(container.text().split('')).each (i, char) ->
    replacement_container_text += '<span>' + char + '</span>'

  container.html(replacement_container_text)   
    
  container.click (e) ->
    console.log(container.children('span').index $(e.target))