How to change specific data of dialog box using js. | Community
Skip to main content
Level 3
April 9, 2021
Solved

How to change specific data of dialog box using js.

  • April 9, 2021
  • 1 reply
  • 1033 views

In my dialog I want to change specific content like in my dialog I have written "Search result for {{currentPage}}". Now I want to change only content of {{currentPage}} using js. How can that be done?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Asutosh_Jena_

Hi @shagunmalik 

Using jquery you can do something like below:

 

<div class="something">Search result for {{currentPage}}</div>
var replaceString = $(".something").text();
var text = replaceString.replace("{{currentPage}}", "whatever text");
$(".something").text(text);

 

Thanks! 

1 reply

Asutosh_Jena_
Community Advisor
Asutosh_Jena_Community AdvisorAccepted solution
Community Advisor
April 9, 2021

Hi @shagunmalik 

Using jquery you can do something like below:

 

<div class="something">Search result for {{currentPage}}</div>
var replaceString = $(".something").text();
var text = replaceString.replace("{{currentPage}}", "whatever text");
$(".something").text(text);

 

Thanks! 

Level 3
April 9, 2021
Hi @asutosh_jena_, can we doo it using id?