Adicionar classe ao corpo JavaScript
var body = document.body;
body.classList.add("body_class");
Light Ladybird
var body = document.body;
body.classList.add("body_class");
openModal = (event) => {
document.body.classList.add('modal-open');
this.setState({ showModal: true });
}
hideModal = (event) => {
document.body.classList.remove('modal-open');
this.setState({ showModal: false });
}
var someElement= document.getElementById("myElement");
someElement.className += " newclass";//add "newclass" to element (space in front is important)
element.classList.add('class');
element.classList.remove('class');
document.body.className += ' home';