How would I set mulitple CSS classes for an HTML element, with at least one normal class and one or more Javascript variables as classes?
Here's how I tried to do it, putting it in like a normal script:
<div class="style-a <script type="text/javascript">style-b</script>">
Then I saw that someone recommend this:
<div onload="this.class=style-a;">
But I'm pretty sure that would only work for one class.
Thoughts? Thanks in advance.
this.classwouldn't work for any classes, as it'sthis.className. In newer browser you can usethis.classList.add('style-a').this.class='style-a class2'?