var snabbdom = require('../../commonjs/snabbdom.js'); var patch = snabbdom.init([ require('../../commonjs/modules/class').default, // makes it easy to toggle classes require('../../commonjs/modules/props').default, // for setting properties on DOM elements ]); var h = require('../../commonjs/h').default; // helper function for creating vnodes
window.addEventListener("DOMContentLoaded", function () { var container = document.getElementById('container');
var vnode = h('div#container.two.classes', [ h('span', 'This is bold '), ' and this is just normal text', h('a', "I'll take you places!") ]); // Patch into empty DOM element – this modifies the DOM as a side effect patch(container, vnode); })