function copyToClipboard(str) {
	const input = document.createElement("input");
	input.value = str;

	document.body.appendChild(input);

	input.select();
	input.setSelectionRange(0, str.length);
	document.execCommand("copy");

	input.remove();
}