dynamically set styles of a div with an attribute row-id=””

I have a div which contain row-id=”
this row-id dynamically changes

so I want to give it background color

It is a react.js project. and i want to achieve this in jsx file.

I want something like-

from DOM get element with row-id=’someId’, and give it background color


I have a DOM rendered. It contains many divs, spans etc
Now on click of a button I want to select a div with attribute row-id=’abc’
and change its background color to gray