HTML id with javascript to trigger a write to clipboard

When I run this script (embedded in a HTML page) ‘GG’ isn’t copied to the clipboard. Can someone help/explain why and assist me in getting it working? Thanks.

document.getElementById("blah3");
let s ="GG";
navigator.clipboard.writeText(s);