replace() : Replace occurance of the string by another string in JavaScript

JS Script :

<html>
<body>
<script type="text/javascript">
var str="I am living in Pune";
document.write(str.replace("Pune","India"));
</script>
</body>
</html>

Output in Browser :

I am living in India