you would imagine this would be easy to implement, but oh well..
anyway, I have an element to which classes are added or removed based of interaction on the site.
You have to check if class attribute:
class
.
// with class attribute but no class // even without class attribute so no class attr = $("#mydiv").attr("class") hasClass = (attr == undefined || attr.replace(/\s+/, '') == "" ) 0 讨论(0) 查看其它8个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复