Prev Demo
Replacing With Global And Case-Insensitive Search In Javascript.
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> </head> <body> <h1>Replacing with global and case-insensitive search</h1> <p>Click the below button to replace the Emirates with Lufthansa.</p> <input type="button" value="Replace" onclick="Function()" /> <p id="myId">Emirates flights having Emirates girls, Emirates logo tags</p> <script> function Function() { var a = document.getElementById("myId").innerHTML; var r = a.replace(/Emirates/gi, "Lufthansa"); document.getElementById("myId").innerHTML = r; } </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output