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

251
Visualizações
javascript: how to copies a part of html containing images to the clipboard without using the execCommand command

the goal is to copy a div containing text and an image to create the body of an email to be pasted on the email client. I can do this with the execCommand (copy) command but being deprecated I would like to arrive at a solution using the Clipboard API. With Clipboard I can copy the text via the write function passing the html element by id but this eliminates any formatting of the text and images.

application that create template for email body

    var toCopy = document.getElementById("riepilogonegozio")
    var r = document.createRange();
    r.selectNode(toCopy);
    console.log(r)
    window.getSelection().removeAllRanges();
    window.getSelection().addRange(r);
    console.log(r)
    document.execCommand('copy');
    window.getSelection().removeAllRanges();
about 4 years ago · Juan Pablo Isaza
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