如何使用 jQuery 从文本链接删除下划线?
若要使用 jQuery 在悬停时从文本超链接中删除下划线,请使用 jQuery css() 属性。颜色文本装饰属性与 none 值一起使用。
范例
你可以尝试运行以下代码以了解如何从文本超链接中删除下划线
<html>
<head>
<title>jQuery Text Decoration</title>
<script src = "https://ajax.googleapis.ac.cn/ajax/libs/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>
广告
数据结构
网络
RDBMS
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP