检查jQuery中是否存在Attribute('id')-CheckifAttribute('id')ExistsinjQuery
作者:寄到家的_259 | 来源:互联网 | 2023-06-04 20:05
HowcanIcheckifanattributeIdexistsinjQuery?如何检查jQuery中是否存在属性Id?Isearchedaroundandfou
How can I check if an attribute Id exists in jQuery?
如何检查jQuery中是否存在属性Id?
I searched around and found that this should work:
我四处搜索,发现这应该有效:
if ($(this).attr('id').attr('id'))
{
}
I still get this error: TypeError: Object gauge1 has no method 'attr'
我仍然得到这个错误:TypeError:对象gauge1没有方法'attr'
6 个解决方案