JSFiddle - React, Tailwind, and code Playground

HTML

<table><tr>
<td>Akshay Hulyalkar</td>
    </tr>
</table>

<input type="button" value="replace me!" id="btn"/>

JavaScript

$("#btn").click(function() {
    var text = $("td").text();
    var chars = "Aks";
    console.log(text);
    
    text = text.replace(chars, '<span style="font-weight:bold; color:#808080;">'+chars+'</span>');
    
    $("td").html(text);
});