如何使用 jQuery 從文字連結刪除下劃線?
若要使用 jQuery 在懸停時從文字超連結中刪除下劃線,請使用 jQuery css() 屬性。顏色文字裝飾屬性與 none 值一起使用。
範例
你可以嘗試執行以下程式碼以瞭解如何從文字超連結中刪除下劃線
<html>
<head>
<title>jQuery Text Decoration</title>
<script src = "https://ajax.googleapis.com/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