tp

tp is the single global entry point of the Tripous JavaScript runtime. It is both a namespace and a function. As a namespace, it contains constants, classes, type checks, DOM helpers, formatting helpers, event helpers, and the rest of the runtime. As a function, tp(selector) is a very small shortcut for selecting one DOM element.

TripousJS deliberately uses this single global object instead of JavaScript modules. The browser loads generated bundles such as tp.js, tp-Data.js, tp-UI.js, and later specialized bundles such as tp-Grid.js. Those bundles add their types and helpers under the same tp namespace.

This first Core demo shows the most basic ideas: the global tp object, the tp() selector function, the more explicit tp.Select() and tp.SelectAll() helpers, and the simple value/text/html helpers.

tp as namespace

tp is a function object. That means it can be called as tp(...), but it also carries members such as tp.Version, tp.Ready(), tp.Object, and tp.Component.

tp(selector) as function

tp("#DemoInput") returns the first element that matches the selector. Passing an element returns the same element. Passing a missing selector returns null.

tp.Select() and tp.SelectAll()

tp.Select() is the explicit element selector helper. tp.SelectAll() returns an array of matching elements. Both can search the whole document or inside a parent element.

One Two Three

Value, Text, and Html helpers

tp.Value() gets or sets an element value. tp.Text() works with text content. tp.Html() works with inner HTML.

Text target
HTML target

Common type helpers

Core helpers such as tp.IsString(), tp.IsNumber(), tp.IsBlank(), and tp.IsHTMLElement() are used throughout the runtime to keep checks readable.

Clear output

The output below records what each check did. These examples intentionally use simple code so the behavior is easy to follow from the source preview.