Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

329
Vistas
I have written code to copy the link from box but is it showing me the following error
    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');  
  }

I have written the code to copy the text from element but its showing the error Argument of type 'HTMLCollectionOf' is not assignable to parameter of type 'Node'. Type 'HTMLCollectionOf' is missing the following properties from type 'Node': baseURI, childNodes, firstChild, isConnected, and 46 more.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Change getElementsByClassName code, this might help.

const links = document.getElementsByClassName("copylink" ).item(0);

Ref: https://developer.mozilla.org/en-US/docs/Web/API/Range/selectNode

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda