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

84
Views
Append closing then opening HTML tag with Javascript/Jquery

I have a scenario and in that I want to append a closing tag then some other tag after that opening Tag of the first closed Tag. For Example: I have this code <ins>123678</ins> and I want to append <b>46</b> in between 3 and 6. I tried this code while putting my cursor in between 3 and 6

document.execCommand('insertHTML',false,'</ins><b>45</b><ins>');

But it is not giving me desired output. I want my output like this

<ins>123</ins><b>45</b><ins>678</ins>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You could try to replace

<ins>123678</ins>

with

newHTML= "<ins>123"+"<b>45</b>"+"678</ins>"

using jquery

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!