I want to do something simple, give a rule of style to a part of a text
<span id="frase">la cancion me hace recordar una sensacion</span>
<script type="text/javascript">
frase = document.querySelector("#frase").innerHTML
frase.slice(-3) //ion
</script>
How can I apply a style rule to the output of my slice
function?
The idea is to color it to show it of the word.
If styles can not be applied to normal text, then the possible solution would be to put the substring within a strong element
<span>sensac<strong>ion</strong></span>