Source Code: (back to article)
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
</head>
<body>
<button type="button" onclick="redirectFunc()">Click and go to the page</button>
<script>
function redirectFunc() {
window.location.href = "https://www.w3docs.com/";
}
</script>
</body>
</html>