<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:
When we Click on the Button the c-sharpcorner Website will be open.