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

300
Vistas
How to set caret position in contenteditable div relative to innerText

When I edit a contenteditable div's innerHTML, it forces the caret to the start of the div. I want to move it back to its position relative to the div's innterText afterwards. I am able to get/store the caret's position, but using selection/range objects to move it back there is too damn confusing for me.

tldr how do you move a caret in a contenteditable div relative to innerText

I found lots of almost-applicable on here but ran into weird bugs with each function I came across.

Would really appreciate any help as this is the final hurdle in my project and I've been stuck for a while

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