Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

125
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda