<html>
<body>
<h1>JavaScript String Methods</h1>
<p>Replace "Microsoft" with "W3Schools" in the paragraph below:</p>
<button onclick="myFunction()">Try it</button>
<p id="demo">Please visit Microsoft!</p>
<script>
function myFunction() {
let text = document.getElementById("demo").innerHTML;
document.getElementById("demo").innerHTML =
text.replace(/MICROSOFT/i, "W3Schools");
}
</script>
</body>
<!-- /js/tryit.asp?filename=tryjs_string_replace_insensitive Thu, 06 Feb 2025 19:15:24 GMT -->
</html>