![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
jquery
她最爱橘了
这个作者很懒,什么都没留下…
展开
-
jQuery基础
1. 通过id查找标签$('#id属性值')2. 通过class查找标签$('.class属性值')3. 通过标签属性查找标签$('[标签名="属性值"]')4. 父子选择器css( )函数 给找到的标签添加css样式1. 样式名 2. 样式值$('#h>span').css(xxxxxx)5. 后代选择器$('#h span').css(xxxxxx)6. 通过标签属性名进行查找$('标签...原创 2018-05-11 20:15:26 · 204 阅读 · 0 评论 -
jQuery修改属性值
1. attr()函数获取标签的某个属性值$('标签').attr('属性名')2. attr( )函数修改标签的属性值$('#id定位标签').attr('原有属性名', '修改后的属性名')3. attr( )添加标签的属性注:原有标签属性没有的话, 会添加修改后的标签属性$('#id定位标签').attr('原有属性', '修改后的属性')有则改之, 无则添之4. 删除某个属性$('#id...原创 2018-05-11 21:06:41 · 8322 阅读 · 3 评论 -
jQuery-Dom节点操作
1. jQuery追加标签 $('body').append('<h1 style="color: red;" class="c">hello world</h1>') $('.c').css('font-size','100px')2. 移除标签$('.c').remove()3. 添加父级标签, 在某个标签的外层添加标签$('.c').wrap('&...原创 2018-05-11 21:25:46 · 859 阅读 · 0 评论 -
jQuery事件
<button>点我</button> <div id="d"></div>1. 单击事件$('button').click(function () { console.log('button:我被点了....') })2. 双击事件$('#d').dblclick(function () {...原创 2018-05-11 21:36:58 · 102 阅读 · 0 评论 -
jQuery-form表单事件
<form action="#" method="get"> <input type="text" name="user"> <input type="password" name="pwd"> <button type="submit原创 2018-05-11 21:45:18 · 3145 阅读 · 0 评论 -
jQuery-get请求
url = 'xxxxxx'1. 发起get请求 // 1.url地址 2请求成功后执行的函数(data,status,xhr) $.getJSON(url,function (data,status,xhr) { console.log(data) $('p').text(data.date) ...原创 2018-05-11 21:51:42 · 1135 阅读 · 0 评论 -
jQuery基础
一: 下载到jquery官网下载所需要的文档点击打开链接在你的项目下新建一个js文件, 将整个页面复制到该文件中二: 操作与使用新建一个html文件引入该文件 <title>jQuery基础</title> <script src="js/jquery-3.3.1.min.js"></script>这样就是正式开始进行操作了:1. 通过id...原创 2018-06-07 22:34:10 · 135 阅读 · 0 评论