copyURL1(){ const links = document.getElementsByClassName("copylink" );`enter code here` const range = document.createRange(); range.selectNode(links); const selection = window.getSelection(); selection.removeAllRanges(); selection.addRange(range); const successful = document.execCommand('copy'); }He escrito el código para copiar el texto del elemento, pero muestra el error El argumento del tipo 'HTMLCollectionOf' no se puede asignar al parámetro del tipo 'Nodo'. Al tipo 'HTMLCollectionOf' le faltan las siguientes propiedades del tipo 'Node': baseURI, childNodes, firstChild, isConnected y 46 más.
Cambie el código getElementsByClassName, esto podría ayudar.
const links = document.getElementsByClassName("copylink" ).item(0);Ref: https://developer.mozilla.org/en-US/docs/Web/API/Range/selectNode