changing an attribute in a loop

Good day,
I need advice on mass changing attributes of e.g. a text field. I have several text fields t0 to t20 where I want to change the color of the text and the background when a button is pressed. I would like to do this in bulk, in a loop, but I don’t know how.
for(i.val=0;i.val<=20;i++)
{and here I would like to write something like this:
t[i.val].pco=0
t[i.val].bco=65535
and all text cells will have black font and white background
}
Sorry if this issue has already been addressed, I couldn’t find it…
Can this be achieved? Thanks for the replies and have a nice day.