如何使href在IE8中的按钮上工作 [英] How to make href will work on button in IE8

查看:141
本文介绍了如何使href在IE8中的按钮上工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望 href 将在IE8中的 type =button上运行。

I want href will work on type="button"in IE8.

<a href="submit.php"><input type="button" value="Submit" class="button" /></a>

其他浏览器工作正常,但在IE8上面的代码无效。如何解决?

Other browser working fine but on IE8 the code above not working. How to fix it?

更新

<form action="submit.php" method="post"">
<input type="submit" value="Submit" class="button" />
</form>

我知道这种方式可以做到。但我想知道其他方法如何让它在IE8上运行而不必拥有< form>< / form>

I know this way can be done. But I want to know other ways how to make it work on IE8 without to have the <form></form>

推荐答案



onclick =window.location = this.parentNode.href;/>

onclick="window.location=this.parentNode.href;"/>

this.parentNode可以引用一个标签,所以...它应该工作或测试getAttribute甚至

this.parentNode can refer to a tag so... it should work or test getAttribute even

这篇关于如何使href在IE8中的按钮上工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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