jj
    Preparing search index...

    Function h

    • Hyperscript helper to create JJHE instances. The h function provides a concise way to create DOM wrappers with attributes and children, similar to hyperscript helpers found in other libraries.

      Parameters

      • tagName: string

        The HTML tag name.

      • Optionalattributes: Record<string, string> | null

        Attributes to set on the element. Can be null or undefined.

      • ...children: Wrappable[]

        Children to append (strings, nodes, or other JJHE instances).

      Returns JJHE

      The created JJHE instance.

      It returns a JJHE instance which wraps the native HTMLElement.

      You may recognize it from other libraries:

      This is not exactly a replacement, but it roughly follows the same idea.

      // Create a simple div
      h('div', { id: 'app' }, 'Hello World')

      // Create a nested structure
      h('ul', { class: 'list' },
      h('li', null, 'Item 1'),
      h('li', null, 'Item 2')
      )