How to create a new element with class name in JavaScript
JavaScript provides a native way to create new elements. A single createElement()
method is available inside the document object which is supported by all browsers. But it’s not enough to create a new element with a class name or any other attributes for that matter.