oTree Forum >

Chage chat nickname appearance based on content

#1 by Xinxin

Hi Chris, 

I am trying to change the appearance of each participant, for example, a participant with nickname "Blue A" will have blue colored nickname and messages in the chat box. Is it possible to do it in Javacript? 

I tried to use getElementbyClassName but the chat message is a live collection, it doesn't seem to work. 

Thanks in advance,

#2 by Chris_oTree

Instead of javascript use CSS

#3 by Xinxin

What if I need multiple colors? Say I have blue and green As, is it possible to differentiate them in CSS?

Write a reply

Set forum username