Wednesday, June 19, 2013

jQuery Redirect to Another Page with Button Click in JavaScript ?

<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.js"></script>
</head>
<body>
<input type="button" id="btnclick" value="Redirect" />
<script type="text/javascript">
$(function() {
$("#btnclick").click(function() {
var url = 'http://interviewquestionbysahil.blogspot.com';
$(location).attr('href', url);
})
});
</script>
</body>
</html>

No comments:

Post a Comment