DEV Community

Discussion on: Beyond appendChild: Better convenience methods for HTML

Collapse
 
jonathanburnhill profile image
Jonathan Burnhill

I keep coming back to this because I love it and am using the object assign right now, I have a little question.

Is there a way in object assign to insert children such as for instance if I want to put a x next to a image to say delete?

Collapse
 
samthor profile image
Sam Thorogood

I don't think so, sorry. You can't assign to .children in this way.

Collapse
 
jonathanburnhill profile image
Jonathan Burnhill

Thanks for your reply, I was playing with it a little bit probably when I should have been concentrating on work 😂.
You can use innerHTML though!! And I called the on click with a function so learned 2 new things yesterday about it