Forum Discussion
KeithTrodden-48
9 months agoCommunity Member
Changing colour of textboxes
Hi everyone,
Just a question if anyone out there can help me...
Does anyone know how to use the trigger that executes javascript in Articulate Storyline to change the colour of a textbox when yo...
Nedim
9 months agoCommunity Member
You can achieve that with JS where you can change all text boxes given that you assign them the same "Alt name". Then Execute JS when the user clicks the button (video attached). Tricky part is to target the text color due to the complex SL Html structure. It's not a fontColor, it's a fill that needs to be targeted instead. But again I would always prefer SL solution or similar to Walt has suggested above. Although JS solution is quicker. Here is the code:const texts = document.querySelectorAll('[data-acc-text="text"]');
texts.forEach(text => {
const txt = text.querySelector('text');
if (txt) {
txt.style.fill = '#C0504D';
}
});