Jquery学习笔记

来源:互联网 发布:qq飞车莱瑟xa数据 编辑:程序博客网 时间:2024/06/16 17:54

1.选择器selector:IDSelector $("#IdName"), ClassSelector$(".className"), TAG SELECTOR$("tagName") $Sbling

2.方法:

类操作selector.addClass("className") ,selector.removeClass("className") ,

样式操作selector.css("propertyName","propertyValue");

属性操作selector.prop("PropertyName","PropertyValue"),

html操作selector.html("html content"),

text操作selector.text("text content"),

删除元素 selector.remove() 

追加到其他元素中selector.appendTo(parentSelector);

复制元素selctor.clone()

获取父元素selector.parent()

获取样式元素第那个 $("className:nth-child(n)")

获取样式元素奇偶个$("className:odd,even")

3.属性连接符号为-.


原创粉丝点击