如何知道jQuery对象的类型? [英] How to know the type of an jQuery object?

查看:62
本文介绍了如何知道jQuery对象的类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要检测它是<option>还是其他

I need to detect whether it's a <option> or something else

推荐答案

您可以使用 方法来检查jQuery对象是否与选择器匹配.

You can use the is method to check whether a jQuery object matches a selector.

例如:

var isOption = someObj.is('option');

这篇关于如何知道jQuery对象的类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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