Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

170
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!