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

122
Views
How to generate a copyable link to clipboard that is clickable in gmail

I have to generate a url to the clipboard when user click the button. The question is, I have no idea how can I make this url clickable when I paste it into email. The result turns out to plain text. And I am using ReactJs as my frontend framework. I have tried using Clipboard.writeText(), but it not works. I also tried to paste html code to email, but all I get is plain text. I have seen other website implemented this function, but I really don't know how to do this.

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

0

You can copy a string to the clipboard by turning on the following:

 navigator.clipboard.writeText('text');

full example

 const [text, setText] = useState(""); const handleChange = (e) => { setText(e.target.value); }; const handleCopy = () => { navigator.clipboard.writeText(text); }; return ( <div> <input type="text" value={text} onChange={handleChange} /> <button onClick={handleCopy}>Copy</button> </div> );

If that doesn't work, I'd check the console for other errors.

More in documents

about 4 years ago · Juan Pablo Isaza Report

0

I think I've solved this myself. Simply put the html code as type [text/html] in the clipboard API and it can be copied as seen on a web page.

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!