DEV Community

Discussion on: 4 handy ways to create an element with properties in Javascript

Collapse
 
kevinhch profile image
Kevin

The classic 2:
const classicTwo = document.createElement('div')
classicTwo.setAttribute('id','fizz')
And now u can add this element to a parent element