HOME ➔ SUPPORT ➔ Community ➔ General CourseLab issues ... Setting properties of objects
Setting properties of objects
  View type:
Hello Community,
Is there a built-in way to change a property of an object through an action? Example: suppose I have a textbox named box1 and I want to change its background color from white to grey ...
I'm thinking smth along the line of $box1.backgroundColor='grey'
Thanks in advance,
Aaldrik
 
Yes, you can, with javascript.
Open the textbox in the textbox editor and click the button 'Edit HTML'.

Give the span around the text you want to change color, an id:
<P><SPAN style="FONT-FAMILY: Arial; COLOR: #000000; FONT-SIZE: 12px" id=dummyId>DummyText</SPAN></P&gt

Make an action
document.getElementById('dummyId').style.color = '#0000ff';

[:cool:]
 
 
Hello Barend,
Thanks for your swift response; I'm back on track now [:)]
Greetings,
Aaldrik
Subject:
Message options
No additional options