So basically, I am copying content of one div to other like this
$("#button").click(function() {
var a = $("#div1").html()
$("#div2").html(a);
I want the variable 'a' to change all the occurrence of a character/string and copy it to div2.
$("#button").click(function() {
var a = $("#div1").html().replace("$money","$cash");
$("#div2").html(a);
So, basically, I want the replace the occurrence of '$money' with '$cash' and store it inside test1. The above code copies the exact content but does not replace '$money' with '$cash'.
What am I doing wrong?