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

169
Vistas
Mouse cursor highighted data

I wanna ask how to get strings data when I highlight the text by mouse. For example when I highlight some text on the website. I should get the text copied to my API automatically. I don't have time to copy-paste. I wanna do it automatically copy and paste when I highlight the text. I have basic knowledge of Js and php.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

There isn't any onhighlightext event function or anything like that, but a solution would be to bind the onmouseup event to check if any text is selected. See example for selecting highlighted text here: On Text Highlight Event?

Another part of your question is the copy to clipboard function. Here is a text copy example function, which works for my use cases:

  <html>
     <head>
     </head>
     <body>
         <button onclick="toClipboard('Some text!')">Copy me</button>
         <script>
         function toClipboard(str) {
             tc = document.createElement('textarea');
             tc.value = str;
             document.body.appendChild(tc);
             tc.select();
             document.execCommand('copy');
             document.body.removeChild(tc);
         };
         </script>
     </body>
 </html>
about 4 years ago · Juan Pablo Isaza Denunciar
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