Skip to content

Set text

Sets the text of the target element to the specified value.

We can pick one of three options here:

  1. Text - Inserts a string of text in the target element
  2. HTML - Inserts HTML elements into the target element
  3. Markdown - Converts markdown to HTML, and injects the HTML into the target element.

Plain text

This option inserts a string of text into the target element.

For example, if we wanted to set the text of an h1 heading element to 'Welcome back' we would do it like this:

js
(c, f, i, n, r, v, e, t) => {
  return 'Welcome back'; 
};

Here is a video example, where we're setting the value of the main heading.

HTML

This option inserts HTML elements into the target element. This option is great if you're getting formatted data (HTML) from an API, or if you're rendering data that you wrote with a rich text editor.

Keep in mind that Wized DOES NOT sanitize the injected HTML.

Markdown

The Markdown option works similarly to HTML. This option converts Markdown syntax into HTML first, and then it injects the HTML into the target element. This option should be used if you're getting Markdown syntax in your request response, or if you have a Markdown editor in your app.