Skip to content

Instantly share code, notes, and snippets.

@parrfolio
Created October 14, 2012 19:53
Show Gist options
  • Save parrfolio/3889634 to your computer and use it in GitHub Desktop.
Save parrfolio/3889634 to your computer and use it in GitHub Desktop.
ClassList
{
length: {number}, /* # of class on this element */
add: function() { [native code] },
contains: function() { [native code] },
item: function() { [native code] }, /* by index */
remove: function() { [native code] },
toggle: function() { [native code] }
}
Support: http://caniuse.com/classlist
Example: myDiv.classList.add('myCssClass');
Info: http://davidwalsh.name/classlist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment