fd-prepend:以函数方式添加 DOM 元素

时间:2021-06-19 11:31:22
【文件属性】:
文件名称:fd-prepend:以函数方式添加 DOM 元素
文件大小:6KB
文件格式:ZIP
更新时间:2021-06-19 11:31:22
JavaScript fd-前置 以功能方式添加 DOM 元素。 安装 npm install fd-prepend --save 用法 let prepend = require ( 'fd-prepend' ) ; let elem = require ( 'fd-elem' ) ; let prependtoBody = prepend ( document . body ) ; let p = elem ( 'p' , 'No, I am' ) ; prependtoBody ( p ) ; assert . equal ( document . body . firstChild . innerText , 'No, I am' ) ; // true. 应用程序接口 prepend :: parent -> child 一个柯里化函数,它接受: parent -> 必须将子项添加到的 DO
【文件预览】:
fd-prepend-master
----.jshintrc(611B)
----.gitignore(933B)
----package.json(924B)
----.travis.yml(116B)
----gulpfile.js(691B)
----index.es6(150B)
----LICENSE(1KB)
----CONTRIBUTING.markdown(330B)
----index.js(194B)
----test.js(520B)
----README.markdown(760B)
----test.es6(341B)
----.editorconfig(197B)

网友评论