超级好用的JQuery(极速总结,最常用的知识点集合)

一、常用方法

$("#box").addClass()//加类名
		 .removeClass()
		 .toggleClass()//切换类
		 .html()
		 .css()
		 .text()
		 .each((index,item)=>{})//循环
		 .attr()//加属性
		 .prop()//与attr一样,当为true或者false这个时候只能用prop
		 .removeAttr(属性名)//移除属性

二、事件绑定以及解绑

绑定,有2种

$("#box").mouserover(function)


$("#box").on({"click" : function})

三、JQuery中的Ajax

$ajax({
	type: "GET"
	url : ""
	data:{}
	success:function(result){}
})

//或者

$get("url",data,function(result){})

猜你喜欢

转载自blog.csdn.net/qq_45549336/article/details/106857709