+ 1
Copy text not working
https://code.sololearn.com/W3su0XYR7jjd/?ref=app Just check the JavaScript copy text is not working and shows error for me.
3 ответов
+ 2
Can you please just edit it and re-upload the code?
+ 1
You need to use <x> as content or value of an HTML element (usually a text input).
You should get a reference to the element e.g. let's name it <element>, and then you go
<element>.select();
<element>.setSelectionRange(0, 99999);
And finally ... document.execCommand("copy");
+ 1
Sorry, looks like I have to run again ...
Someone will point you out soon 👍