Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

321
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!