attach(div());
div.attach(); // added as child of div
p.attach(); // added as child of div
attach(div()); // New div
div.attach(); // added as child of new div
p.attach(); // added as child of new div
detach(); // Back to previous div
detach(); // No attached tag
Generated using TypeDoc
Attach the given tag. This means that when other tags are created marked as attachable (using
<tag_name>.attach()
,tag('<tag_name>', [], true)
), they will be added as children of this tag. You can call attach multiple times, and the last attach tag will be used. Then when you've finished, you can call detach to go back to the previously attached tag if there is one, or clear the attached tag.