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

99
Views
Add message animation on click

I want to add a 'Copied!' animation to my javascript that triggers when you click on a link. I want it to appear next to the mouse and disappear after 2 seconds of appearing.

I went hunting on the internet for similar animation examples but couldn't find anything.

Apologies if this is a tall order of a question.

function copy(that){
var inp =document.createElement('input');
document.body.appendChild(inp)
inp.value =that.textContent
inp.select();
document.execCommand('copy',false);
inp.remove();
}

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

If you just want to delete the element 2 seconds later, you can use setTimeout:

setTimeout(() => inp.remove(), 2000);
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!