Javascript – Replace variables with values from a database in a string containing HTML
I have a string received from an editor, which includes HTML tags, like this: const htmlString = "<div>Account <span contenteditable="false">{{account}}</span></div>. <div>Hello <span contenteditable="false">{{hello}}</span></div>" In this content, there are two variables with the format {{account}} and {{hello}}. In my database, I…