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

172
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
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