JSFiddle - React, Tailwind, and code Playground

HTML

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body>
    <div id="divMsg1">This is <i>just</i> a line</div>
    <br/><br/>
    <input type="button" value="Apply some style" onclick="ApplySomeStyle();" /><br />
</body>
</html>

JavaScript

function ApplySomeStyle() {
    var oDiv = document.getElementById("divMsg1");
                                         
    oDiv.lastChild.previousSibling.firstChild.parentNode.style.color = "#FF0000";
}