I've got some tasks to do and I think about how to do it easier. I have to create (using JS) div element with some class and inside this element I want to create another 2 elements (img src and button) and I'm not sure how to do it.
I can do it like:
const newElement = document.createElement('div');
newElement.classList.add('someClass')
after that I can add it to HTML doc and then create another elements (img src and button) and add it to the div I've created before but is there any faster option to create it?