
第二章jQuery选择器
发布日期:2021-05-14 13:19:20
浏览次数:12
分类:精选文章
本文共 1600 字,大约阅读时间需要 5 分钟。
jQuery������������������������������������ ��������� ���������-up������ HTML������������(elements)Riskem �� WWWWWW,_SELECTOR__SELECTORS ��������eon percocietorsse_UI dan nodalness managent.
1. Basic selectors
- Tag selectors: $(���h2���) -> css("color", "red");
- Class selectors: $(".title") -> css("color", "red");
- ID selectors: $("#title") -> css("color", "red");
- Combined selectors: $(���h2,h3,.title,#title���) -> css("color", "red");
- Global selectors: $("") -> css("color", "red");
2. Tiered selectors
- Descendant selectors: $("#box p") -> css("color", "red");
- Child selectors: $("#box > p") -> css("color", "red");
- Adjacent selectors: (".p2+p") -> css("color", "red");
- Sibling selectors: (".p2 ~ p") -> css("color", "red");
3. Attribute selectors
- [name]: Elements with name attribute.
- [name='name']: Elements where name attribute value is 'name'.
- [name!=name]: Elements where name attribute value is not 'name'.
- [name^=na]: Elements where name attribute starts with 'na'.
- [name~='p2~p'] -> Elements where name attribute is followed by p2 and p elements.
4. Filter selectors
- li:first: First list item.
- li:last: Last list item.
- li:even: Even-indexed list items.
- li:odd: Odd-indexed list items.
- li:gt(2): List items after the 2nd one (������0������).
- li:lt(2): List items before the 2nd one (������0������).
- li:eq(2): The third list item (������0������).
- :header: All header tags.
- :focus: Focused elements.
5. Visibility filters
(selection of elements based on their visibility.)
6. Focus related
- $("[name='text']").focus();
7. Form-related methods
- $("[name='pass']").val("values");
- $("#input").val();
发表评论
最新留言
哈哈,博客排版真的漂亮呢~
[***.90.31.176]2025年05月01日 03时02分22秒
关于作者

喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
ObjectInputStream、ObjectOutputStream
2021-05-14
线程生命周期
2021-05-14
JVM内存模型
2021-05-14
反射机制
2021-05-14
反射Field、Method、Constructor
2021-05-14
可变长度参数
2021-05-14
类加载器子系统
2021-05-14
堆空间常用参数总结
2021-05-14
逃逸分析-堆分配对象
2021-05-14
常量池、运行时常量池
2021-05-14
GC算法
2021-05-14
GC补充
2021-05-14
3、条件查询
2021-05-14
5、分组函数 / 聚合函数
2021-05-14
8、子查询
2021-05-14
cordova打包apk更改图标
2021-05-14
开启与配置SMTP服务器
2021-05-14
postman基本使用方法
2021-05-14
域名解析步骤
2021-05-14
APP卡片式设计
2021-05-14