Clipboard API do not returning result

I am using the clipboard api to retrieve the clipboard into a variable so I can add information into it and return it to the clipboard. When I return it to the clipboard it does not paste the result and only keeps on the clipboard the previous copy

<script>
const getTextAC = async () => {
	const textC= await navigator.clipboard.readText();

	var copyTxtori=document.getElementById('route').value;
	var copyTxtClip="FS36$whT9Vc2|"+copyTxtori+"|"+textC;
	
	alert(copyTxtClip);
	
	navigator.clipboard.writeText(copyTxtClip);
	
	alert(copyTxtClip);

}
</script>

Please repost your code in the proper format with the link


Have you tried waiting for the clipboard to update?

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.