I am using JavaScript and I want to add/remove a Class attribute if a button is clicked. I am able to add the class, but I don\'t know how to remove it. how can I do that?
The nicest way to set classes with Javascript is to use the className property:
// to add box.className = 'move'; // to remove box.className = '';