jQuery HTML

//                在被选元素的结尾插入内容
                $(this).append()
//                在被选元素的开头插入内容
                $(this).prepend()
//                在被选元素之后插入内容
                $(this).after()
//                在被选元素之前插入内容
                $(this).before()
//                append,prepend是在元素内嵌入;after,before是在元素之外追加,是有区别的

//                删除被选元素及其子元素
                $(this).remove()
//                删除被选元素的子元素
                $(this).empty()
//                过滤被删除的元素     (移除class为"box"的元素)
                $(this).remove(".box")
//                向被选元素添加一个或者多个"类"
                $(this).addClass()
//                从被选元素删除或者几个"类"
                $(this).removeClass()
//                添加/删除"类"切换
                $(this).toggleClass()
//                返回指定css属性的值
                $(this).css("background")
//                设置css的样式
                $(this).css("background":"#000000")
//                设置多个css样式
                $(this).css("background":"red","font-size":"20px")
//                设置或返回元素的宽   (不包括内边距,边框,外边距)
                $(this).width()
//                设置或返回元素的高   (不包括内边距,边框,外边距)
                $(this).height()
//                返回元素的宽度 (包括内边距)
                $(this).innerWidth()
//                返回元素的高度 (包括内边距)
                $(this).innerHeight()
//                返回元素的宽度  (包括内边距,边框)
                $(this).outerWidth()
//                返回元素的高度  (包括内边距,边框)
                $(this).outerHeight()

 

posted on 2017-10-16 17:22  大力水手和超级玛丽  阅读(133)  评论(0编辑  收藏  举报

导航