There is a variable let say var content which holds some HTML content and this HTML also contains a JavaScript variable let say ${id}. Now I want to update the value of ${id} variable. I have tried with the following code but it's not working.
var id = '';
var content = `<div class="row well margin_btm_ten">
<div class="col-md-1">
<b>ID is ${id}</b>
</div>`;
row_id = 2;
setTimeout(function(){
console.log(content)
});
row_idyou have never used that.idand have it reflected incontent. You will need to explicitly re-buildcontentwhen changingid.