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

261
Views
Replace string without deleting structure of html

When i try to replace string 0,50 with javascript 'mydiv' has been deleted/moved

Example

<div id="para1"><div class="mydiv"></div>0,50</div>

When i try to replace 0,50 by 80 i do :

document.getElementById("para1").innerText = "80"

or with jQuery

$("#para1").text("80")

then the result is :

<div id="para1">80</div>

during the operation it delete <div class="mydiv"></div>

How can i do to keep structure of html and result like this :

<div id="para1"><div class="mydiv"></div>80</div>
about 4 years ago · Juan Pablo Isaza
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!