> For the complete documentation index, see [llms.txt](https://sway-technologies.gitbook.io/sway-charts-pro-scripts-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sway-technologies.gitbook.io/sway-charts-pro-scripts-documentation/sway-charts-pro-user-defined-indicators/adding-html-to-the-chart/7.3-sending-messages-from-the-html-to-the-udi.md).

# 7.3	Sending messages from the HTML to the UDI

Your HTML can send messages to your UDI using window\.parent.postMessage(). For example:

```
window.parent.postMessage("Message to UDI", "*");
```

This is received by the UDI in a UDI.onHTMLMessage() function. For example:

```
UDI.onHTMLMessage = function(msg) {
	// msg == "Message to UDI"
};
```

Common uses include notifying the UDI of an action such as button click, or a change of value in some input field in the HTML.
