Javascript examples for String:Quiz
Use the replace() method to replace "World" with "Universe".
<!DOCTYPE html> <html> <body> <p id="demo"></p> <script> var txt = "Hello World"; document.getElementById("demo").innerHTML = txt.replace("World", "Universe"); </script>/* w w w.j a va 2s .co m*/ </body> </html>