Javascript examples for String:replace
Replace "@[" in the string
<html> <head></head> <body> <p id="demo">this is a test! @[</p> <button onclick="myFunction()">Try it</button> <script> function myFunction() {// w w w .j av a 2 s.c o m var str = document.getElementById("demo").innerHTML; var res = str.replace(/@\[/g, "new value"); document.getElementById("demo").innerHTML = res; } </script> </body> </html>