It is very simple when you use jquery. First of all add a css with class name letter
.letter:hover { color: orange; }
Then use the simple jquery code.
<script type="text/javascript"> $(document).ready(function(){ var letters = $('h4').text(); //Here we are taking the text var data= ''; //Here looping the each character and adding to span element with class letter. for(var letter of letters) { data+="<span class='letter'>"+letter+"</span>"; } $('h4').html(data); }) </script>
Question and answer is powered by AnsPress.io