使用jQuery测试元素是否具有特定类 [英] Testing if an element has a certain class with jQuery

查看:63
本文介绍了使用jQuery测试元素是否具有特定类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试测试元素上是否存在类intra-field-label.该元素具有多个类.我该怎么办?

I'm trying to test for the presence of class intra-field-label on an element. This element will have multiple classes. How may I do this?

推荐答案

使用hasClass()

http://api.jquery.com/hasClass/

这篇关于使用jQuery测试元素是否具有特定类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆