We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 276053f commit 9d8e8c6Copy full SHA for 9d8e8c6
HUI.js
@@ -0,0 +1,26 @@
1
+/** HUI.js | JavaScript UI Layout Library
2
+ * @author Oyedele Hammed Horlah
3
+ * @version 2.0
4
+ * @since January 1, 2017
5
+ * @see http://www.oyedelehammed.ml/HUI.html
6
+*/
7
+
8
+function hui( tag, attrs ) {
9
+ var children = [].slice.call( arguments, 2 ),
10
+ d = document;
11
+ var node = d.createElement( tag );
12
+ if ( attrs ) {
13
+ for ( var attr in attrs ) node.setAttribute( attr, attrs[attr] );
14
+ }
15
+ if ( children ) {
16
+ children.forEach(function( child ) {
17
+ node.appendChild(
18
+ (typeof child == 'string') ? d.createTextNode( child ) : child
19
+ );
20
+ });
21
22
+ return node;
23
+}
24
+function huiRender( node, view ) {
25
+ document.querySelector(view).appendChild( node );
26
0 commit comments