当前第2页 返回上一页
例:从所有的 <p> 元素移除 "intro" 类:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | <!DOCTYPE html>
<html>
<head>
<meta charset= "utf-8" >
<script src= "https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js" >
</script>
<script>
$(document).ready( function (){
$( "button" ).click( function (){
$( "p" ).removeClass( "intro" );
});
});
</script>
<style type= "text/css" >
.intro{
font-size:120%;
color:red;
}
</style>
</head>
<body>
<h1>这是一个标题</h1>
<p class= "intro" >这是一个段落。</p>
<p class= "intro" >这是另一个段落。</p>
<button>移除所有P元素的 "intro" 类</button>
</body>
</html>
|
更多编程相关知识,请访问:编程视频课程!!
以上就是jquery怎么去除css样式?的详细内容,更多文章请关注木庄网络博客!
返回前面的内容
相关阅读 >>
jQuery与ajax的区别是什么
jq如何动态添加动态css样式
jQuery有哪些选择器
jQuery css()和attr()的区别是什么
炫酷实用的jQuery/html5菜单图文详解
jQuery怎么操作select
jQuery ligerui是什么?
jQuery如何判断单选按钮是否选中
jQuery怎么操作css设置高度
jQuery怎样判断属性是否存在
更多相关阅读请进入《jQuery》频道 >>
人民邮电出版社
本书对 Vue.js 3 技术细节的分析非常可靠,对于需要深入理解 Vue.js 3 的用户会有很大的帮助。——尤雨溪,Vue.js作者
转载请注明出处:木庄网络博客 » jquery怎么去除css样式?