I have CSS style properties "sprinkled" through out my JavaScript code.
Here is an example line:
label_element.style.opacity = 0;
I was planning on moving all CSS out of the code except className changes.
For example if I need to dynamically change some CSS dynamically with JavaScript, I plan to consolidate the changes to a className change as such:
.new_class{
label_element.style.opacity = 0;
}
Therefore to dynamically change CSS all changes are made with class changes as such:
div_el.className = "new_class";
All CSS remains in the CSS file this way. JavaScript only has access to class names.
I wanted to verify/validate this is a good way to do it.