onEvent copy to clipboard

How to I copy an item to clipboard.

let email = "email@example.com"

export function button1_onClick(event, $w) {
	
	//Now copy email to clipboard
	
}

This is not supported in Wix Code as it requires access to restricted methods or elements.

WixCode understands all of Javascript, except for anything that accesses the DOM. Accessing document elements such as document, window, div, span, button, etc is off-limits. The way to access elements on the page is only through $w.