JSFiddle - React, Tailwind, and code Playground
HTML
<p>texto</p>
<p style="background:yellow">segundo texto</p>
<p>outro texto</p>
JavaScript
var list = document.getElementsByTagName("p");
for(var i = 0; i < list.length; i++)
{
if(list[i].style.background == 'yellow')
{
alert("sim");
//Função que quiseres fazer caso tenha aquele estilo
}
else
{
alert("no");
//Função que quiseres fazer caso não tenha aquele estilo
}
}