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

171
Vistas
How to replace text with html

I am trying to replace a phone number with a new phone number.
However, it's not working with the <p> tags right now.

I can replace it with a word and it changes it. But when I use HTML it doesn't work

<script>
$(function() {
$("#navbarPhoneNumber").html("<p id='phonenumber'></p>");
});
</script>
about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

You can use innerHTML after you get your element to replace your text


  
  document.getElementById("navphonenumber").innerHTML = phonenumber;

Here is a solution I wrote

about 4 years ago · Juan Pablo Isaza Denunciar

0

Don't use jquery for this simple example, just use DOM's simple API function .getElementById.

document.getElementById('navbarPhoneNumber').innerText = <new phone number>
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