Replace placeholders on page from within itself | SoloLearn: Learn to code for FREE!


Replace placeholders on page from within itself

I have a template page that has to be repopulated with values from data source. I wonder how to do it. Excerpt of the page html: ... <td colspan="2"> <strong>QUOTATION [ID]</strong><br> [Organisation_Details]</td> </tr> <tr> <td colspan="2"> <b>Client:</b><br> [Client]<br> ... So I have to replace [ID] and [Client] here, what is the best approach to do it? Thanks.

3/4/2019 10:44:43 AM

Dejan Dozet

2 Answers

New Answer


//hey de do can you explain it more, Maybe i can help you if i understand it.


Hello Shudarshan Rai 👑 thank you so much, but ive already found solution with a help of people on I will post that solution a little bit later here is my code for replacement of placeholders from the page itself: first: var data = $("body").html(); second: $.each(myRecords, function (key, val) { third: do many find replace + adding rows etc fourth: $("body").html(data); and that is it!