JSFiddle - React, Tailwind, and code Playground

HTML

<p id="ppp">текст красится в красный</p>
<div id="ppp" style="color: #000000; border:2px solid; width:155px; height:55px;">
див не реагирует</div>

JavaScript

var bobik = document.getElementById('ppp');
bobik.onmouseover = function() {this.style.color = '#ff0000';};
bobik.onmouseout = function() {this.style.color = '#000000';};