widgets/index.js
2024-05-16 05:00:08 +08:00

11 lines
346 B
JavaScript

import { div, span, pre } from './main.js'
document.body.appendChild(div.w(128).h(64).childs([
span.text('Hello world!'),
new span({ textContent: 'Hello world!' }),
]))
fetch('/index.js').then(res => res.text()).then(text => {
document.body.appendChild(pre.p('2rem').bg('#ececec').text(text.substring(0, text.indexOf('fetch'))))
})