<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<button onclick="myFunction()">try it!</button>
<p id="demo1">CSS,CSS,CSS,CSSEL,css,CSS</p>
<script>
function myFunction()
{
var str = document.getElementById("demo1").innerHTML;
var txt = str.replace("CSS","JS");
document.getElementById("demo1").innerHTML = txt;
}
</script>
</body>
</html>