An even simpler bit of sugar over the DOM that I embed whenever I need just a little bit of JS:
function $E(t,p,c) {
const el=document.createElement(t)
Object.assign(el,p)
el.append(...c)
return el
}
Usage: const button = $E('button', {onclick: () => alert('click!')}, [
$E('img', {src: '/assets/icon-lightbulb.png'}, []),
'Ding!',
])
(With thanks to 'goranmoomin: https://news.ycombinator.com/item?id=23590750)