日期:2014-05-16  浏览次数:20514 次

为什么HTML代码在IE10兼容模式不能运行?
代码如下:

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
<body>
    <a href="http://www.baidu.com"><input type="button"  value="登录"> </input></a>
</body>
</html>
————————————————————————————
在IE10的兼容模式中点击登录没反应,取消兼容模式可以执行,在chrome中也能执行。
谢谢!!
------解决方案--------------------

<a href="http://www.baidu.com">登录</a>

input标签 是不需要闭合的
或者 你直接删除input  点击登录
------解决方案--------------------
用css写出按钮的样子   你不觉的这样写不符合代码规范吗
------解决方案--------------------
引用:
Quote: 引用:


<a href="http://www.baidu.com">登录</a>

input标签 是不需要闭合的
或者 你直接删除input  点击登录


不是,因为我想要保留input的button样式对用的按钮,所以采用input


删掉a标签,直接用<input type="button"  value="登录" onclick=parent.location='http://www.baidu.com'>就可以了
------解决方案--------------------
引用:
Quote: 引用:

Quote: 引用:


<a href="http://www.baidu.com">登录</a>

input标签 是不需要闭合的
或者 你直接删除input  点击登录


不是,因为我想要保留input的button样式对用的按钮,所以采用input


删掉a标签,直接用<input type="button"  value="登录" onclick=parent.location='http://www.baidu.com'>就可以了


上面用到事件了,直接加个from吧。。
<from method="post" action="http://www.baidu.com">
   <input type="button" value="登陆">
</from>