RunKit + npm: @tbtk-site/tbtk-create-element

node v14.20.1
version: master
endpointsharetweet
const { JSDOM } = require("jsdom"); const { createElement } = require("@tbtk-site/tbtk-create-element"); global.document = new JSDOM(`<!DOCTYPE html><html><body></body></html>`).window.document; createElement(document.body, "table") .child("thead", (thead) => thead.child("tr", (tr) => tr.child("th", (th) => (th.ref.innerHTML = "header 1")) .child("th", (th) => (th.ref.innerHTML = "header 2")) .child("th", (th) => (th.ref.innerHTML = "header 3")) ) ) .child("tbody", (tbody) => tbody.child("tr", (tr) => tr.child("td", (td) => (td.ref.innerHTML = "col 1")) .child("td", (td) => (td.ref.innerHTML = "col 2")) .child("td", (td) => (td.ref.innerHTML = "col 3")) ) ); console.log(document.body.innerHTML);
Created from: https://npm.runkit.com/%40tbtk-site%2Ftbtk-create-element
Loading…

no comments

    sign in to comment