Skip to content

Instantly share code, notes, and snippets.

@tjvantoll
Last active August 29, 2015 14:03
Show Gist options
  • Save tjvantoll/db83d89b0bafbeecaefe to your computer and use it in GitHub Desktop.
Save tjvantoll/db83d89b0bafbeecaefe to your computer and use it in GitHub Desktop.
Class Name Formatting Question

The following code adds a [placeholder] class name to the <body> element:

document.body.classList.add( "foo-bar" );

Question: How should the class name inserted at [placeholder] be formatted?


  • 1: foo-bar
  • 2: "foo-bar"
  • 3: “foo-bar”
  • 4: foo-bar
  • 5: "foo-bar"
  • 6: “foo-bar
@codylindley
Copy link

7: class="foo-bar" that is exact and clear IMO

@tjvantoll
Copy link
Author

Thanks for the feedback everyone. At the end of the day I decided to go with #4 based on Scott's reasoning, but the fact that very smart people picked several different choices made me feel better about my confusion on this :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment