繁体   English   中英

Javascript Groovy按钮在IE中不起作用

[英]Javascript Groovy button doesn't work in IE

我已经在此页面底部创建了按钮: http : //www.constructionline.co.uk/static/acclaim/index.html

但是它们不充当IE中的链接。 我正在使用IE11。有人可以帮忙吗?

带有type = button的<input>不能正常工作,因为您自己需要它。 它在其他浏览器中起作用的唯一原因是它包装在<a> 这不是正确的HTML,我相信IE的行为是正确的,而其他浏览器则更加灵活。

您可以做的就是删除<a>并将onclick事件添加到<input> ,例如:

<input type="button" name="Benefits" class="groovybutton" value="Find out more benefits &gt;&gt;" onclick="location.href = 'acclaim/acclaimbenefits.html'" onmouseover="goLite(this.form.name,this.name)" onmouseout="goDim(this.form.name,this.name)" style="background-color: rgb(169, 34, 22); border-color: rgb(169, 34, 22);">

然后的问题是,没有JavaScript支持的浏览器将无法访问该链接。

确实,我认为您根本不需要<input> ,您应该能够做到这一点:

<a href="acclaim/acclaimbenefits.html" class="ac-no-arrow">Find out more benefits &gt;&gt;</a>

您的goLite()和goDim()javascript可能会替换为CSS

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM