Basic Text

setText() is the simplest DOM++ setter.

It provides a chainable wrapper around native textContent mutation while preserving direct DOM access.

Important

DOMPP does not introduce custom wrappers around DOM elements.

setText() mutates the native DOM node directly and returns the same element instance for chaining.

Code

const basicText =
  document
    .createElement("div")
    .setAttributes({
      class: "card"
    })
    .setText(
      "Hello DOM++"
    );

app.setChildren(
  basicText
);
Notes
  • setText() internally mutates textContent
  • setters return the same DOM element instance
  • DOM nodes remain fully native and accessible

Live Preview