$create should read opt.appendChild if selector is string

This commit is contained in:
tophf 2018-04-12 20:42:01 +03:00
parent 3d6b46a14b
commit 5b9fd4454b

View File

@ -191,6 +191,7 @@ function $create(selector = 'div', properties, children) {
children = properties;
} else {
opt = properties || {};
children = children || opt.appendChild;
}
const idStart = (selector.indexOf('#') + 1 || selector.length + 1) - 1;
const classStart = (selector.indexOf('.') + 1 || selector.length + 1) - 1;