星空网 > 软件开发 > Java

jquery css属性练习

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html ="http://www.w3.org/1999/xhtml"> <head> <title>css属性(专门用于class属性设置)</title> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> <style type="text/css">     .c1{color:red;}    .c2{font-size:50px;}    .c3{width:100px;height:100px;border:1px solid red;} </style> <script type="text/javascript" src='/images/loading.gif' data-original="jquery-1.7.1.min.js"></script> <script type="text/javascript"> /*   addClass  //添加一个样式   removeClass //移除一个样式   toggleClass //切换样式(如果有就移除,如果没有就添加)   hasClass  //判断是否具有某个样式 */     window.onload=function(){      $('#btnOk').click(function(){        //添加c3样式         //$('div').addClass('c3');        //移除一个样式        //$('div').removeClass('c1');        //切换样式(如果有就移除,如果没有就添加)          //$('div').toggleClass('c3');           //判断是否具有某个样式          if($('div').hasClass('c1')){            alert('具有c1属性');          };      });    }; </script> </head> <body>  <div class='c1 c2 '>test</div>  <hr /> <input type="button" id='btnOk' value='确定' /> </body></html>

 




原标题:jquery css属性练习

关键词:CSS

CSS
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

亚马逊突然延迟发货,赶紧做好自查:https://www.ikjzd.com/articles/137745
第三条新改变!亚马逊,开始大规模清零冻结资金:https://www.ikjzd.com/articles/137746
Shopify选品浅谈:https://www.ikjzd.com/articles/137747
Shopee转运仓及揽货服务圣诞节和元旦放假通知:https://www.ikjzd.com/articles/137748
2020Shopee年终复盘,为何虾皮可以溯流而上?:https://www.ikjzd.com/articles/137749
英国迎来至暗时刻!伦敦紧急“封城”,11国对英实行停飞令等:https://www.ikjzd.com/articles/137750
​TikTok发生了什么?美区增长首次停滞,准入管理力度加大:https://www.kjdsnews.com/a/1836407.html
2024年如何找到在TikTok上发帖的最佳时间:https://www.kjdsnews.com/a/1836408.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流