Prev Demo
JavaScript
>
Replacing Character/Characters
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> </head> <body> <h1>Replace using JavaScript</h1> <script> var v = "my text"; document.write(v.replace("my", "our")); </script> <p><strong>Note:</strong> The value "my" is replaced with the value "our".</p> </body> </html>
Note: We DO NOT save your trial code in our database.
Output