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
JavaScript simple alert on Click
Edit the text of label on click using jQuery
How to declare multiple variables in one statement in Javascript?
How to get selected text from a select box using jQuery?
jQuery show input text inside div after on click event
JavaScript example to change image on click
jQuery get the coordinates of div clicked
How to change text after click event using JavaScript?
How to current URL, HOST and URL attributes using JavaScript or jQuery?
jQuery check if an element is visible or hidden