This site is mobile accessible. Press the "Tap Here" button to use a smaller font-size.

Smartphone icons created by Freepik - Flaticon

JS String Methods

String replace() With a Regular Expression

Replace "Microsoft" with "W3Schools" in the paragraph below:

Please visit Microsoft!

function myFunction() {
  let text = document.getElementById("demo").innerHTML;
  document.getElementById("demo").innerHTML =
  text.replace(/microsoft/i, "W3Schools");
}