Hi, I'm having a groupElement of lines, planing to have different style attributes for active/passive.
I probably could change their class by having different groupElements for each state and dynamically change the members...
But before I try that approach - is there a directer way like .toggle() or something similar?
Answered! Go to the Best Answer.
Best AnswerThis may help. Beware inconsistency between 'className' and '.class'.
I think I did some messing around with .class in widget-factory.
While I don't fully understand, you can change an element's .class at runtime. You could add or remove class names to that string and, in theory, the relevant styles would be displayed.
Best Answerhmmm... ok. I hoped so, but don't find the syntax. (I never had used classList so far and it doesn't seem to be supported?)
To explain better: I have a couple of lines and want them to have multiple classes (active passive) with different styles.
Then I want to switch the applied class (style) for some elements, but not for all (Instead of having 2 layers for bg and progress using just one )
Unfortunately I can't test in sim. It doesn't seem to take the changes I make
Best Answeroh great! yes!! that's exactly what I was looking for 😊
Need to have another look at the factory then... I'm so out of...