<!DOCTYPE html>
<html>
<body>
<html>
<body>
<button onclick="myFunction()">Try it</button>
<p id="demo">Paul PAULA paula paul paul</p>
<script>
function myFunction() {
var str = document.getElementById("demo").innerHTML;
var txt = str.replace(/paul/g,"atm");
document.getElementById("demo").innerHTML = txt;
}
</script>
function myFunction() {
var str = document.getElementById("demo").innerHTML;
var txt = str.replace(/paul/g,"atm");
document.getElementById("demo").innerHTML = txt;
}
</script>
</body>
</html>
</html>