Skip to main content
HTML attributes are the no-code equivalent of LiveChatWidget.call(). Use them on website builders, CMS pages, and landing pages where adding a script isn’t practical.

How it works

The data-text-action attribute turns any element into a chat widget control. When a customer clicks the element, the chat widget runs the action named in the attribute. The element can be a button, link, image, banner, or anything else. Pass the settings for an action as separate attributes on the same element. Attribute names aren’t case-sensitive, so both data-text-messageDraft and data-text-messagedraft work. Two details affect whether a click runs the action:
  • Elements added to the page later, for example by a single-page app, work without any extra setup.
  • Clicks start working once the chat widget has finished loading. Earlier clicks do nothing.
The chat widget doesn’t prevent the element’s default click behavior. An <a href="/contact"> element opens the chat widget and follows the link, and a <button> element inside a form also submits that form. Use <button type="button"> to avoid this.

Actions

The data-text-action attribute takes one of three values: maximize, minimize, or send_message. Any other value does nothing and prints a console error listing the allowed actions.

Maximize

Maximizes the chat widget.
Attributes

Minimize

Minimizes the chat widget. The action takes no attributes other than data-text-action.

Send message

Sends a message on the customer’s behalf and maximizes the chat widget. Use it for quick-question elements, such as FAQ entries. If the group is offline and continuous chats are turned off, the message isn’t sent.
Attributes

Clicks inside an element

The action also runs when a customer clicks an element nested inside the one that carries data-text-action. This lets you turn a whole banner into a trigger: