Prev Demo
Replacing The Elements By Using Return Function.
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> </head> <body> <p>Click the below button to replace by using return function.</p> <input type="button" value="Replace" onclick="Function()" /> <p id="myId">EMIRATE FLIGHTS HAVING EMIRATE EMPLOYS, EMIRATE GIRLS, EMIRATE LOGO TAGS.</p> <script> function Function() { var a = document.getElementById("myId").innerHTML; var r = a.replace(/EMIRATE|EMPLOYS|TAGS/gi, function Function(A) { return A.toLowerCase();}); document.getElementById("myId").innerHTML = r; } </script></body> </html>
Note: We DO NOT save your trial code in our database.
Output