Skip to content

regBodyDom

regBodyDom(html): string

注册 DOM 元素到 body

将 DOM 元素添加到文档的 body 中

Parameters

NameType
htmlstring

Returns

string

Example

ts
// 创建一个新元素并添加到 body
const div = document.createElement('div');
div.textContent = 'Hello, world!';
regBodyDom(div);

Released under the MIT License.