zhf.create-element

1.0.1 • Public • Published

创建元素

const createElement = require('zhf.create-element');

const elementNode = createElement({
    elementName: 'div',
    style: {width: '100px', height: '100px'},
    customAttribute: {hello: 'world'},
    attribute: {
        className: 'g-test',
        innerHTML: '我是被创建的元素',
    },
});

console.log(elementNode.outerHTML); // <div style="width: 100px; height: 100px;" data-hello="world" class="g-test">我是被创建的元素</div>

Readme

Keywords

none

Package Sidebar

Install

npm i zhf.create-element

Weekly Downloads

1

Version

1.0.1

License

ISC

Unpacked Size

8.93 kB

Total Files

11

Last publish

Collaborators

  • zhouhuafei