// ------------------------------------------------ // Tool // ------------------------------------------------ const T_ = document.createTextNode.bind(document); function E_(t = 'div', p = {}, c = []) { let el = document.createElement(t); Object.assign(el, p); el.append(...c); return el; } // ------------------------------------------------ // Usage // ------------------------------------------------ const App = E_('section', { id: 'thing', className: 'test2' }, [ E_('p', {}, [T_('some thing77')]), ]); document.body.append(App);