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