<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JavaScript Example</title>
</head>
<body>
<script>
var text = "Hello, world!";
var modifiedText = text.replace("world", "there");
document.write(modifiedText); // Prints "Hello, there!"
</script>
</body>
</html>
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.