DOM creation and removal

This demo covers Tripous helpers that create, insert, append, prepend, and remove DOM nodes. Each button resets the sample workspace first, then runs one focused group of helpers so the result is easy to inspect.

Some helpers create elements for you, such as tp.Div() and tp.AppendElement(). Others accept an existing Node or an HTML string, such as tp.Append(), tp.Prepend(), tp.AppendNode(), and tp.InsertNode().

Workspace

This is the parent element passed to all helpers. Watch this area after each button click.

Create elements

Uses tp.el(), tp.Div(), tp.Span(), tp.Paragraph(), and tp.Break().

Append and prepend

Uses tp.Append() and tp.Prepend() with HTML strings and existing elements.

Insert and remove

Uses tp.AppendElement(), tp.InsertElement(), tp.AppendNode(), tp.InsertNode(), tp.Remove(), and tp.RemoveChildren().