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

292
Vistas
Convert Ordered and Unordered List to readable text with bullets/numbers on pasting in HTML textarea element

I'm trying to find a solution to convert ordered and unordered list from a webpage when copy-pasted to a textarea should be converted to readable list.

Please check following fiddle for better explanation:

https://jsfiddle.net/bodmwghj/2/

<textarea id="final"></textarea>

If we copy paste list from webpage to our input textarea field it loses the "bullets" / "numbers"

Instead if we can prepend the list items with atleast a bullet • symbol and a space that would make more sense and would keep text still readable without having to allow HTML or using tinyMCE editors.

I feel this would be more tricky but if we can append incremental numbers to ordered list, nothing like it, but I am okay to bring bullets there as well if numbers can't be generated on the fly.

So far I could find addEventListener for "paste" event, but I am confused how I can reach the desired solution.

Please let me know if I can explain any further. Hope I can find a solution to this. Any help / possible pointers to solutions is appreciated.

EDIT: Copied text may include formatted HTML and other text. Requirement is only to convert lists. JS Fiddle URL updated.

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