Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

249
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda