replace method in JavaScript

<html>
<head>
<script type="text/javascript">
function replacemydoc()
  {
  window.location.replace("http://www.c-sharpcorner.com")
  }
</script>
</head>
<body>

<input type="button" value="Click Here To Replace the document" onclick="replacemydoc()" />

</body>
</html> 


Output:

1.png

When we Click on the Button the c-sharpcorner Website will be open.
Ebook Download
View all
Learn
View all