How can I add a class to a DOM element in JavaScript? by IT Nursery How do I add a class for the div? var new_row = document.createElement('div'); 13 Answers 13