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

250
Vistas
JS, How can I remove text under conditions of starting at < and ending at >?

I have a text html document and I would like to delete all html code and leave all the plain text.

<p>Random text generated by some method</p>
<p style="text-align:center;">centered text example</p>
<p>Full name</p>
<p>IRSP</p>

output should be:

Random text generated by some method centered text example Full name IRSP

I'm kinda of a new so any docs related to this are welcome.

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

0

You can use a DOMParser to parse the string and get the result's textContent:

const str = `<p>Random text generated by some method</p>
<p style="text-align:center;">centered text example</p>
<p>Full name</p>
<p>IRSP</p>`

const res = new DOMParser().parseFromString(str, 'text/html').body.textContent;
console.log(res)

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