Skip to content

Instantly share code, notes, and snippets.

@mrfoxtalbot
Created November 25, 2019 14:29
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save mrfoxtalbot/6f56094adcaa6a27ca51800a974977d4 to your computer and use it in GitHub Desktop.
JS Add inline CSS styles
// Selecting element
var elem = document.getElementById("intro");
// Appling styles on element, not camelCase on attributes
elem.style.color = "blue";
elem.style.fontSize = "18px";
elem.style.fontWeight = "bold";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment