如何使用jQuery从文本超链接中删除下划线?
要使用jQuery从悬停时的文本超链接中删除下划线,请使用jQuerycss()属性。颜色文本装饰属性的值设置为none。
示例
您可以尝试运行以下代码,以了解如何从文本超链接中删除下划线:
<html>
<head>
<title>jQuery Text Decoration</title>
<script src = "https://cdn.staticfile.org/jquery/2.1.3/jquery.min.js"></script>
<script>
$(document).ready(function() {
$('a').hover(
function () {
$(this).css({"text-decoration":"none"});
});
});
</script>
<style>
a {
text-decoration: underline;
}
</style>
</head>
<body>
<a href="#">Demo text</a>
</body>
</html>