The text() method returns the current event text or sets a new value.
DayPilot.Event.text()
DayPilot.Event.text(newText)The new value is applied when you call DayPilot.Scheduler.events.update().
newText (string) - new event text.
When setting a new text value, it automatically updates event HTML. See also DayPilot.Event.client.innerHTML().
Since version 2020.4.4701, strings set using text() are automatically HTML-encoded to help prevent XSS attacks. To set raw HTML, use client.html() or modify data.html (see DayPilot.Event.data).
const oldText = e.text();
e.text("New text");XSS Protection [doc.daypilot.org]
XSS Protection [doc.daypilot.org]