April 26, 2015

Redirecting the users using JQUERY and JavaScript


Suppose you have created a button and when the user clicks that button you want navigate the user to some other page that is what I am going to teach you in this tutorial. You can also user <a href=""></a> tags to do the same thing but I am teaching you how to do that without anchor tags.

html

<button id="home">Home</button>

js

$(document).ready(function(){
        $('#home').click(function(){
              window.location.href="home.php";
        });
});

See how simple it is. If you have any doubts comment below or mail me @ ething4pc@gmail.com

No comments: