I want to create a javascript to copy text to clipboard and display an alert coupon copied and when user close it or clicks ok it should visit another website in new page.
basically i am using wordpress's siteorigin pagebuilder widget in which i can only provide the javascripct name as "script.js".
so what I want is when that script runs it takes the button id and copy its text to clipboard and then shows a error message and tells code copied and when user cancels the alert or click ok then it should open a link.