Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <body> <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() { var str = document.getElementById("demo").innerHTML; var txt = str.replace(/microsoft/i,"W3Schools"); document.getElementById("demo").innerHTML = txt; } </script> </body> <!-- Mirrored from www.w3schools.com/js/tryit.asp?filename=tryjs_string_replace_regexp by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 07:24:35 GMT --> </html>
Result:
Try it Yourself - © w3schools.com