addClass Function


/ Published in: JavaScript
Save to your folder(s)

Function to look if an element has a class, if it doesn't simply add it to the element. If it does have a class add it to the class that is already there. Function expects 2 values, the element to add the class to, and the new class name (value).

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.