手抄报 安全手抄报 手抄报内容 手抄报图片 英语手抄报 清明节手抄报 节约用水手抄报

jquery中如何使用not方法

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

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

jquery中如何使用not方法

2、在head中引入jquery库

jquery中如何使用not方法

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

jquery中如何使用not方法

4、在head中加入style设置元素之间的距离已经边框颜色等

jquery中如何使用not方法

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

jquery中如何使用not方法

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

© 手抄报圈