Eri*_*ric 1 html internet-explorer internet-explorer-8
此代码适用于Firefox,Chrome和Safari,但对我来说失败了(Windows)IE 8:
<a href='http://google.com'>
<input type="button" name='go' value='go'>
</a>
Run Code Online (Sandbox Code Playgroud)
为什么?我应该使用(笨拙的)onClick事件绕过它吗?
Grrrrr ....
你不能有一个<button>
内部<a>
元素.
你可以添加一些CSS <a>
看起来像一个按钮.
或者绕过它:
<input type="button" value="Google" onClick="javascript:location.href = 'http://google.com';" />
Run Code Online (Sandbox Code Playgroud)