|
|
@@ -9,13 +9,14 @@ import isString from '../lib/lodash/isString.js';
|
|
|
import utils from '../utils.js';
|
|
|
|
|
|
/**
|
|
|
- * Create element with attributes and children.
|
|
|
+ * Creates element with attributes and children.
|
|
|
*
|
|
|
* createElement( document, 'p' ); // <p>
|
|
|
* createElement( document, 'p', { class: 'foo' } ); // <p class="foo">
|
|
|
* createElement( document, 'p', null, 'foo' ); // <p>foo</p>
|
|
|
* createElement( document, 'p', null, [ 'foo', createElement( document, 'img' ) ] ); // <p>foo<img></p>
|
|
|
*
|
|
|
+ * @method utils.dom.createElement
|
|
|
* @param {Document} doc Document used to create element.
|
|
|
* @param {String} name Name of the element.
|
|
|
* @param {Object} attributes Object keys will become attributes keys and object values will became attributes values.
|