网站首页 美食营养 游戏数码 手工爱好 生活家居 健康养生 运动户外 职场理财 情感交际 母婴教育 时尚美容

jquery中如何使用not方法

时间:2024-10-12 13:21:57

1、创建一个名称为not的html文件

jquery中如何使用not方法

3、在body中加入多个p元素,并随机设置p 的classname 为 “classnot”

jquery中如何使用not方法

5、在文档准备方法中加入not方法,在not方法中加入”.classnot“ 意思是返回选中不是class名称为 “classnot”的p元素,并设置背景色

jquery中如何使用not方法

6、在浏览器中运行该文件查看显示结果,class 为空或不是 “classnot”的p侍厚治越元素被设置了背景色为黄色

© 2025 小知经验
信息来自网络 所有数据仅供参考
有疑问请联系站长 site.kefu@gmail.com