body add class js code example Example: add class to body javascript var body = document.body; body.classList.add("body_class");