Client side page redirection can be implemented easily in JavaScript. To do this, you are only required to add a line at the head section of your code.
Redirect from one page to another page after click
<!DOCTYPE html>
<html>
<head>
<script>
function Redirect() {
window.location="https://www.pythonprogramming.in/";
}
</script>
</head>
<body>
<form>
<input type="button" value="Redirect" onclick="Redirect();" />
</form>
</body>
</html>
Redirect using jQuery
<!DOCTYPE html>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js"></script>
<script>
function Redirect() {
$(location).attr('href', 'https://www.pythonprogramming.in/');
}
</script>
</head>
<body>
<form>
<input type="button" value="Redirect" onclick="Redirect();" />
</form>
</body>
</html>
Most Helpful This Week
Get largest number from each sub-arrays
Example to take user input and display on screen using JavaScript
How to get selected text from a select box using jQuery?
JavaScript sort multi dimensional array on specific columns
Write a function that splits an array into groups the length of size and returns them as a two-dimensional array
jQuery move multi select values from one to another multi select list