Last active
March 14, 2016 09:26
-
-
Save yratof/df39cee87913c9f6c42b to your computer and use it in GitHub Desktop.
Vanilla javascript to change CSS of elements
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var elem = document.querySelector( 'body' ); // Pick your element | |
| var value = '0 1px 0 red'; // Change the CSS here | |
| elem.style.textShadow = value; // Apply this value to textShadow | |
| // All CSS in javascript is stripped of hyphens | |
| // and has uppercase letters for all words | |
| // after the first one. IE: text-shadow = textShadow |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment