psytask - v1.1.1
    Preparing search index...

    Function h

    • Creates HTML element, shortcut of document.createElement.

      Type Parameters

      • K extends keyof HTMLElementTagNameMap

      Parameters

      • tagName: K
      • Optionalprops: null | Partial<Merge<(...)[(...)], { style?: ...; dataset?: ... }>>
      • Optionalchildren: null | string | Node | (string | Node)[]

      Returns HTMLElementTagNameMap[K]

      h('div'); // <div></div>

      h('div', { className: 'psytask-center' }); // <div class="psytask-center"></div>
      h('div', { style: { color: 'red' } }); // <div style="color: red;"></div>
      h('div', { dataset: { id: 'my-div' } }); // <div data-id="my-div"></div>

      h('div', null, 'text'); // <div>text</div>
      h('div', null, h('p')); // <div><p></p></div>
      h('div', null, ['text', h('p')]); // <div>text<p></p></div>