im a beginner. this is the first real application i tried to write in javascript and i would love to understand why it doesn’t work?
var button = document.getElementById("button");
var text = document.getElementById("text");
function button() {
text.select();
text.setSelectionRange(0, 99999);
navigator.clipboard.writeText(text.value);
alert("you copied this text");
}
button is a onclick event in html and text is an input in html.
thank you very much