Thank you Math. Removing that line did remove the box, but it also prevented it from copying to my clipboard. However, it helped me understand the problem better.
I was able to get updated code from chatGPT which removes the box
var player = GetPlayer(); var text = player.GetVar("ChatOpening"); copyFunction (text);
3 Replies
You are doing this in your code. The line
document.body.append(textArea)
does that. It adds a textArea to the HTML.Thank you Math. Removing that line did remove the box, but it also prevented it from copying to my clipboard. However, it helped me understand the problem better.
I was able to get updated code from chatGPT which removes the box
var player = GetPlayer();
var text = player.GetVar("ChatOpening");
copyFunction (text);
function copyFunction(tt) {
const copyText = tt;
const textArea = document.createElement('textarea');
textArea.textContent = copyText;
document.body.append(textArea);
textArea.select();
document.execCommand("copy");
document.body.removeChild(textArea);
}
Nice... really should try chatGPT when writing JS too...