Skip to content

Instantly share code, notes, and snippets.

@yratof
Last active March 14, 2016 09:26
Show Gist options
  • Select an option

  • Save yratof/df39cee87913c9f6c42b to your computer and use it in GitHub Desktop.

Select an option

Save yratof/df39cee87913c9f6c42b to your computer and use it in GitHub Desktop.
Vanilla javascript to change CSS of elements
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