<!doctype html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>01 exam</title>
<link rel="stylesheet" type="text/css" href="01 exam.css">
</head>
<body>
<h2>JavaScript String Methods</h2>
<p>Replace "Microsoft" with "W3Schools" in the paragraph below:</p>
<button onclick="myFunction()">Try it</button>
<p id="demo">paul,paula,pauline,panl,paul</p>
<script>
function myFunction() {
var str = document.getElementById("demo").innerHTML;
var txt = str.replace(/\bpaul\b/g,"Ringo");
document.getElementById("demo").innerHTML = txt;
}
</script>
</body>
</html>