@nkeff/cardboard-js
    Preparing search index...

    Function tag

    • This function can do the following based on the first argument:

      • create a tag if you provide a tag name: (div, abbr, custom-tag, ...),
      • wrap around an existing element in the page if you pass in a selector: ('(body)', '(#id)', '(.class)'), any selector is allowed.
      • wrap around an element passed in

      Then it can receive a list of children to be added. Receives a third argument for mounting this tag to the currently mounted tag (context.mp).

      Parameters

      • arg0: string | HTMLElement
      • children: TagChildren = []
      • mountToParent: boolean = false

      Returns CTag

      tag('div');
      tag('(body)');
      tag('(.someclass)');
      tag(document.querySelector('#something'));