Bug Tracker

Modify

Ticket #9657 (closed feature: wontfix)

Opened 2 years ago

Last modified 2 years ago

Extend .hasClass to similar .hasClasses

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

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

comment:1 Changed 2 years ago by rwaldron

  • Owner set to waynepurtonsmith@…
  • Status changed from new to pending

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

  • only one class of many matches?
  • all match?
Last edited 2 years ago by rwaldron (previous) (diff)

comment:2 Changed 2 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 2 years ago by timmywil

  • Priority changed from undecided to low
  • Resolution set to wontfix
  • Status changed from pending to closed
  • Component changed from unfiled to attributes
  • Type changed from bug to feature

I think we're in agreement.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.