jQuery基本介绍
jQuery是JavaScript库封装了许多JS代码
JavaScript库有90%jQuery,和一部分ExtJS
jQuery官网http://jquery.com/
jQuery 讲究的是write less,do more写少做多
jQuery 是为了简化JavaScript开发(选择器,CSS,HTML
事件处理,JS动画,游览期兼容,丰富插件)
jQuery多用于中大型网站开发,是一些前端框架的基础
列如EasyUI,Bootstrap
使用jQuery步骤
1.进入jQuery官网http://jquery.com/下载jQuery库
2.引用:将js文件复制到项目中
3.使用
示例 用JS与jQuery的对比
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>jQuery</title>
<style>
.container{
width: 100px;
height: 100px;
background: blue;
}
</style>
</head>
<body>
<div class="container"></div>
<div class="container"></div>
<div class="container"></div>
<div class="container"></div>
<button onclick="fun01()">点击改变颜色</button>
<br>
<button onclick="fun02()">点击改变颜色(jQuery)</button>
<script src="jquery-3.5.1.js"></script>
<script>
//jQuery 不是一门语言
//jQuery 是JS的框架(JS的升级和简化)<