一个20行左右的强$代码
来源:飘雨之夜 时间:2009-12-25 15:22:00
大致功能:
$() 取得所有元素
$("div") 取得所有DIV
$("#a1") 取得ID为a1的元素
$(".a1") 取得className为a1的元素
$("div.a1") 取得className为a1的DIV元素
$("div:w=1") 取得属性w为1的DIV元素
……
开始自己写了一个,但语法罗嗦,就在51JS发了个帖,根据超级版主biyuan的书写思路整理最终代码如下:
标签:JavaScript,代码,元素
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Python OpenCV学习之图像滤波详解
2021-09-17 18:49:36
![](https://img.aspxhome.com/file/2023/7/118357_0s.jpg)
微信小程序实现日期格式化
2023-07-20 20:28:32
![](https://img.aspxhome.com/file/2023/7/55957_0s.jpg)
在Golang代码中如何自动生成版本号的方法示例
2023-10-14 23:25:36
python神经网络MobileNet模型的复现详解
2022-09-24 19:54:14
![](https://img.aspxhome.com/file/2023/0/120570_0s.png)
Python实现微信好友数据爬取及分析
2021-09-30 04:51:55
![](https://img.aspxhome.com/file/2023/9/101599_0s.jpg)
python模块简介之有序字典(OrderedDict)
2023-12-14 07:46:46
hmac模块生成加入了密钥的消息摘要详解
2023-05-17 09:26:46
![](https://img.aspxhome.com/file/2023/3/70893_0s.png)
Python设计模式之单例模式实例
2023-06-02 12:43:02
DjangoRestFramework 使用 simpleJWT 登陆认证完整记录
2021-03-29 18:34:12
![](https://img.aspxhome.com/file/2023/1/76001_0s.png)
编程活动中几个不良现象
2008-09-01 12:23:00
Pyqt清空某一个QTreeewidgetItem下的所有分支方法
2022-01-24 10:29:46
跟老齐学Python之使用Python操作数据库(1)
2024-01-13 23:56:18
通过备份记录获取数据库的增长情况
2024-01-17 20:21:26
使用IDEA回滚某次提交的代码步骤
2023-06-21 03:15:28
![](https://img.aspxhome.com/file/2023/4/132254_0s.jpg)
Python 3 使用Pillow生成漂亮的分形树图片
2022-05-03 14:53:23
![](https://img.aspxhome.com/file/2023/2/109962_0s.jpg)
Python OpenCV超详细讲解读取图像视频和网络摄像头
2023-11-26 05:22:36
![](https://img.aspxhome.com/file/2023/3/105583_0s.png)
基于mysql乐观锁实现秒杀的示例代码
2024-01-18 02:01:41
![](https://img.aspxhome.com/file/2023/2/74852_0s.png)
python自动化发送邮件实例讲解
2023-11-11 16:01:41
![](https://img.aspxhome.com/file/2023/6/63556_0s.png)
Python利用机器学习算法实现垃圾邮件的识别
2021-02-24 04:31:04
![](https://img.aspxhome.com/file/2023/5/107015_0s.jpg)
python内存动态分配过程详解
2023-10-02 14:58:46
![](https://img.aspxhome.com/file/2023/8/62918_0s.png)