如何在按钮单击事件上重定向页面 [英] How to redirect page on button click event

查看:115
本文介绍了如何在按钮单击事件上重定向页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在表单上使用了一个按钮。点击该链接后如何链接到其他网页/文件?这是我尝试的代码,但不起作用。

I am using a button on my form. How do I link to another web page/file when clicking on that link? Here is the code I tried, but does not work.

<button class="btn" data-bind="click: function() { document.location.href=$(this).attr('RiskAssessmentMain.aspx'); }">back</button>


推荐答案

<input type='button'value='back' class="btn" onclick="document.location.href='RiskAssessmentMain.aspx';"/>

试一试:
http://jsfiddle.net/wzy4B/

这篇关于如何在按钮单击事件上重定向页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆