+ 16
Copy and paste in JS ...
Does anyone know how to copy the text content of an element via JS , i know using the execCommand ("Copy") you can copy selected input elements and copy it to clipboard but can it be done on any other elements than an input?
2 ответов
+ 16
click elements
check the JS code for implementation
as you might notice, the program first selects the text, and then copy
so it does not matter if the element is an input, div, span or whatever
https://code.sololearn.com/WyFNkf7jnqnZ/?ref=app
+ 1
idk