How do you add CSS rules (eg strong { color: red }
) by use of Javascript?
You can add classes or style attributes on an element by element basis.
For example:
text
Where you could do this.style.background, this.style.font-size, etc. You can also apply a style using this same method ala
this.className='classname';
If you want to do this in a javascript function, you can use getElementByID rather than 'this'.