Bug Tracker

Opened 8 years ago

Closed 8 years ago

#9657 closed feature (wontfix)

Extend .hasClass to similar .hasClasses

Reported by: waynepurtonsmith@… Owned by: waynepurtonsmith@…
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');

Change History (3)

comment:1 Changed 8 years ago by Rick Waldron

Owner: set to waynepurtonsmith@…
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 8 years ago by Rick Waldron (previous) (diff)

comment:2 Changed 8 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 8 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.