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

157
Visualizações
How to add line numbers and highlighted the line which is clicked in textarea using ReactJS and pure javascript

I'm trying to make a project like (https://pretty-print-json.js.org/) using react js and tailwind CSS. And I became able to just minify and formatted the JSON data. My project live site (https://json-formatter-eta.vercel.app/)

Now, I have 3 questions. 1 - How can I add line numbers in the text area? 2 - How can I highlight the line which is clicked by the user to edit? 3 - How can I format the text color depending on the key-value? I mean key should have one color and the value should have another color.

Is it possible by using textarea? Or do I have to use content editable div? If I have to use content editable div then how it could be possible to get the value of the div(because if I use innerHTML to get the value of the div it replaces the space with   and then it would not be possible to format the JSON file.)

All I have to done by using pure javascript. Could you anyone help me to done my project please?

about 4 years ago · Santiago Gelvez
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