string-to-dom:向DOM中添加HTML字符串,并返回新HTML元素

时间:2021-05-08 19:05:19
【文件属性】:
文件名称:string-to-dom:向DOM中添加HTML字符串,并返回新HTML元素
文件大小:8KB
文件格式:ZIP
更新时间:2021-05-08 19:05:19
JavaScript 字符串到dom 将HTML字符串添加到DOM并返回新HTML元素。 使用insertAdjacentHTML以高效的方式将给定的字符串添加到DOM并返回新创建HTML元素。 在测试套件中对设置要声明HTML有用。 安装 npm install --save string-to-dom 用法 var stringToDom = require ( 'string-to-dom' ) ; // Add the

tag to the page (right after the <body> tag). // `message` is the newly created HTML element. var message = stringToDom ( '

Hello, World!

' ) ; // Optionally add to a particular node
【文件预览】:
string-to-dom-master
----.gitignore(66B)
----karma.conf.js(606B)
----.nvmrc(7B)
----test()
--------index-test.js(1KB)
----api.md(720B)
----.eslintrc(3KB)
----package.json(2KB)
----src()
--------index.js(1023B)
----readme.md(2KB)
----.eslintignore(5B)
----.npmignore(85B)
----.travis.yml(91B)
----.editorconfig(213B)
----webpack.config.js(399B)
----license(1KB)

网友评论