<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title> <script src="js/jquery-1.11.0.js" type="text/javascript" charset="utf-8"></script>
<style type="text/css">
.redbg{
background: red;
}
.active{
color: beige;
}
</style>
</head>
<body>
<h1>helloworld</h1>
<button>黑白切换</button> <script type="text/javascript">
$('h1').addClass('redbg')
// 添加样式
$('h1').addClass('active')
// 删除样式
$('h1').removeClass('active') var isblack=true
$('button').click(function(){
// if(isblack){
// $('h1').addClass('active')
// isblack=false
// }else{
// $('h1').removeClass('active')
// isblack=true
// }
//切换样式
$('h1').toggleClass('active')
})
.css({
background:'red',
color:'skyblue'
}).html('这是一个按钮')
// $('button').css('background','red')
// $('button').html('这是个可以切换的按钮') </script>
</body>
</html>

最新文章

  1. SQL Server-表表达式基础回顾(二十四)
  2. python之最强王者(6)——列表(List)
  3. 在Nodejs中如何调用C#的代码
  4. 架构师养成记--3.synchronized细节问题
  5. 序列sequence中的cache问题
  6. servlet的九大内置对象
  7. phpcms v9的url优化
  8. session保存用户登录
  9. jquery.SuperSlide.2.1.2--轮播(兼容到IE7 适用于整屏)
  10. Jenkins进阶系列之——01使用email-ext替换Jenkins的默认邮件通知
  11. Rectangle Area——LeetCode
  12. 转:ASCII码表_全_完整版
  13. 优秀的电商平台Jshop栗子
  14. visual studio vode 汉化
  15. 牛客网-2018年湘潭大学程序设计竞赛-F
  16. react-native-vector-icons 图标库使用
  17. Servlet Life Cycle
  18. chrome浏览器访问Google的插件“谷歌访问插件”以及常用插件
  19. CentOS下Crontab安装使用详细说明(转)
  20. java.lang.NoClassDefFoundError: org/jdom/input/SAXBuilder

热门文章

  1. shell 获取当前目录下的jar文件
  2. SpringBoot返回JSON
  3. Springboot + Mysql8实现读写分离
  4. spring配置文件默认名称及位置,ContextLoaderListener监听器作用
  5. centos7版本以上root密码破解
  6. Spring Security 学习记录
  7. 用 Python 爬取网易严选妹子内衣信息,探究妹纸们的偏好
  8. 快速入门Maven(二)(Eclipse构建Maven项目)
  9. repr() Vs str()
  10. phpstorm中xdebug配置和断点调试