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
How to change the height of Textarea on click?
How to scroll page to 1000px from top on page load using jQuery?
How to show hide option list items using jQuery?
Highlight and get the details of table row on click using JavaScript
How to define Global Variable in JavaScript?
jQuery move multi select values from one to another multi select list