Download content of ui.textarea into file

Hi,
with button i want download the ui.textarea content into a file as txt or json (i must decide) how can i do it?
This is my snippet : https://snippet.webix.com/jvgqd9n9
Thanks

Hi,
Please check this sample: https://snippet.webix.com/03yfws6b
https://docs.webix.com/api__html_download.html