DEV Community

Discussion on: Beyond appendChild: Better convenience methods for HTML

Collapse
severusken profile image
kien

const el = Object.assign(document.createElement('div'), {
textContent: Your div now has text,
className: 'and-is-classy',
});

This is sooooo gooood!!!