Not much to add. This button has worked before. it would copy the code within it. Now whenever it is pressed the value="#code"
is displayed to the user but not copied?
<input type="text" class="buttontxt" value="#Code" id="code" disabled>
<button class="button copy" onclick="myFunction()">Copy Code</button>
<script>
function myFunction() {
var copyText = document.getElementById("code");
copyText.select();
document.execCommand("copy");
alert("Copied the code: " + copyText.value);
}
</script>
No idea why this has suddenly happened. It's broken in all of the browsers & on mobile. Would appreciate if someone could make this work again because I'm clueless.