如何使用jQuery删除下划线?
要从jQuery中的文本中删除下划线,请使用jQuerycss()方法。css属性的text-decoration属性没有值。
示例
您可以尝试运行以下代码来删除下划线:
<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("p").on({
mouseenter: function(){
$(this).css({"text-decoration": "none"});
}
});
});
</script>
<style>
p {
text-decoration: underline;
}
</style>
</head>
<body>
<p>Move the mouse pointer on the text to remove underline.</p>
</body>
</html>热门推荐
1 哈尼族祝福语简短
10 新年祝福语鼠年简短创意
11 少儿春节祝福语简短精辟
12 心理考试祝福语结婚简短
13 求婚蛋糕卡片祝福语简短
14 未来求婚祝福语简短英文
15 海南考试祝福语结婚简短
16 学生励志祝福语大全简短
17 客户去旅游祝福语简短
18 端午酒桌祝福语简短