How to change specific data of dialog box using js.

Avatar

Avatar

ShagunMalik

Avatar

ShagunMalik

ShagunMalik

08-04-2021

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?

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

asutosh_j3

Avatar

asutosh_j3

asutosh_j3

08-04-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! 

Answers (0)