Shorthand function for document.createElement. Accepts and appends attributes directly to the newly created element and appends child element, if any.
let element = createElement('p');
let element = createElement('p', { title: 'parent' });
let element = createElement('p', { title: 'parent' }, []);
let element = createElement('p', null, [
'This string will be added as text node'
]);
// You can alias createElement to make your code easier to read
let h = createElement;
let element = h('p', null, [
h('a', { href: 'https://www.google.co.uk' })
h('a', { href: 'https://www.lski.uk' })
]);
let element = h('ul', { title: 'parent' }, [
h('li', { class: 'selected' }, [
h('a', { href: 'https://www.google.co.uk' })
]),
h('li', null, [
h('a', { href: 'https://www.lski.uk' })
])
]);