Bug Tracker

Opened 12 years ago

Closed 12 years ago

#9657 closed feature (wontfix)

Extend .hasClass to similar .hasClasses

Reported by: [email protected] Owned by: [email protected]
Priority: low Milestone: 1.next
Component: attributes Version: 1.6.1
Keywords: Cc:
Blocked by: Blocking:


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');

Change History (3)

comment:1 Changed 12 years ago by Rick Waldron

Owner: set to [email protected]
Status: newpending

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

  • only one class of many matches?
  • all match?
Last edited 12 years ago by Rick Waldron (previous) (diff)

comment:2 Changed 12 years ago by dmethvin

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.

comment:3 Changed 12 years ago by timmywil

Component: unfiledattributes
Priority: undecidedlow
Resolution: wontfix
Status: pendingclosed
Type: bugfeature

I think we're in agreement.

Note: See TracTickets for help on using tickets.