How can I add a class to a DOM element in JavaScript?

new_row.className = "aClassName";

Here’s more information on MDN: className

Leave a Comment