在Javascript中加下划线? [英] Underlining in Javascript?

查看:196
本文介绍了在Javascript中加下划线?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在认识到您无法使用内联伪类后 - 如何写入:hover in inline CSS? - 我调查了让JavaScript与 onMouseOver onMouseOut code>事件来模拟:hover 伪类。我试图删除下划线从文本,当鼠标在它上面。



我试过 onMouseOver =this.style.textDecoration =none ,但我认为对比报价是抛弃一切。



任何想法?



注意:不幸的是,这种效果必须在不使用外部或内部

p $ p> onMouseOver =this.style.textDecoration ='none';


Upon the realization that you can't have an inline pseudoclass -- How to write a:hover in inline CSS? -- I looked into having Javascript do the same job with the onMouseOver and onMouseOut events to simulate the :hover pseudoclass. I'm trying to remove the underline from the text when the mouse is above it. Is there a snippet of Javascript someone can offer that can do that?

I tried onMouseOver="this.style.textDecoration="none"", but I think the contrasting quotations are throwing everything off.

Any ideas?

Note: unfortunately, this effect must be achieved without the use of an external or internal stylesheet (inline only).

解决方案

you can do this by

 onMouseOver="this.style.textDecoration='none';"

这篇关于在Javascript中加下划线?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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