Skip to main content

Bug Tracker

Side navigation

#9657 closed feature (wontfix)

Opened June 23, 2011 12:04PM UTC

Closed June 23, 2011 02:15PM UTC

Extend .hasClass to similar .hasClasses

Reported by: waynepurtonsmith@hotmail.co.uk Owned by: waynepurtonsmith@hotmail.co.uk
Priority: low Milestone: 1.next
Component: attributes Version: 1.6.1
Keywords: Cc:
Blocked by: Blocking:
Description

I was thinking if it would be good to check an element if it has classes, but it'll still should be able to check if the element has one class at a time, e.g.

$('#element').hasClass('classone classtwo classthree');
Attachments (0)
Change History (3)

Changed June 23, 2011 12:27PM UTC by rwaldron comment:1

_comment0: This does fit for consistency with add|remove. What would be ecpected if... \ \ * only one class of many matches? \ * all match?1308838569318388
owner: → waynepurtonsmith@hotmail.co.uk
status: newpending

This does fit for consistency with add|remove. What would be expected if...

  • only one class of many matches?
  • all match?

Changed June 23, 2011 01:57PM UTC by dmethvin comment:2

Not a fan at all. I agree with rwaldron about the confusion around any/all matching. It would complicate and slow the code to do this with very little benefit for the 90% case. Write a separate method as a plugin.

Changed June 23, 2011 02:15PM UTC by timmywil comment:3

component: unfiledattributes
priority: undecidedlow
resolution: → wontfix
status: pendingclosed
type: bugfeature

I think we're in agreement.