Thanks a lot for your reply
I've tried your suggestion but could not really manage it, which is probably caused by my lack of JavaScript.
So I created a very simple widget:
layer1
text1 (="Patriots")
layer2
text1 (="other Team")
I changed the background colour for both layers to red (but left it disabled).
Then I took your code and copied it into the code window, trying "
if(layers[i].text == favoriteTeam)" and "
layers[i].text.indexOf(favoriteTeam) != -1".
Now I was expecting, the layer1 background turns to red but that was not the case (for both).

My original widget has this kind of structure (with 2 additional sliders)
matches [layer]
match1 [layer]
hometeam
guestteam
result
match2 [layer]
hometeam
guestteam
result
...
Sorry for being a bit dummy but could you give me more hints and tell me where is my mistake (in understanding)?
And do I have to create a new function myFavTeam (which has to be loaded "On Change" for each layer)?