Bug Tracker

Ticket #5479 (closed enhancement: fixed)

Opened 5 years ago

Last modified 2 years ago

removeAttr: remove multiple attributes

Reported by: scott.gonzalez Owned by: rwaldron
Priority: low Milestone: 1.7
Component: attributes Version: 1.5.2
Keywords: 1.7-discuss Cc:
Blocking: Blocked by:

Description

It would be nice if removeAttr() accepted multiple attributes. This could work exactly like removeClass() does.

Change History

comment:1 Changed 4 years ago by dmethvin

  • Component changed from unfiled to attributes

comment:2 Changed 4 years ago by rwaldron

  • Keywords needsreview added
  • Owner set to rwaldron
  • Priority changed from major to low
  • Status changed from new to assigned
  • Milestone set to 1.5

Good suggestion

comment:3 Changed 4 years ago by dmethvin

  • Keywords needsreview removed

comment:4 Changed 4 years ago by jitter

#7649 is a duplicate of this ticket.

comment:5 Changed 4 years ago by jitter

  • Version changed from 1.3.2 to 1.4.4

comment:7 Changed 4 years ago by petersendidit

Whats the reason this isn't getting landed?

comment:8 Changed 3 years ago by timmywil

Would we like to add this to attrhooks?

comment:9 Changed 3 years ago by timmywil

  • Version changed from 1.4.4 to 1.5.2
  • Milestone set to 1.7

My guess is this will probably land with the enhancement on removeData in 1.7: #7323

comment:10 Changed 3 years ago by timmywil

#8221 is a duplicate of this ticket.

comment:11 Changed 3 years ago by john

  • Milestone changed from 1.7 to 1.next

We should consider this for 1.7.

comment:12 Changed 3 years ago by john

  • Keywords 1.7-discuss added

Nominating ticket for 1.7 discussion.

comment:13 Changed 3 years ago by rwaldron

+1, Consistent with #7323

comment:14 Changed 3 years ago by jaubourg

+1, yes to API Symmetry

comment:15 Changed 3 years ago by ajpiano

+1, Deffo

comment:16 Changed 3 years ago by timmywil

+1, Yes, but possibly with an access-like function to dry up similar functions.

comment:17 Changed 3 years ago by danheberden

+1

comment:18 Changed 3 years ago by dmethvin

+1, An access-like function would be good here.

comment:19 Changed 3 years ago by john

+1, Obvious missing API.

comment:20 Changed 3 years ago by scott.gonzalez

+1, obviously, I filed the ticket :-)

comment:21 Changed 3 years ago by addyosmani

+1

comment:22 Changed 3 years ago by jzaefferer

+1, one more feature I could take out of my validation plugin

comment:23 follow-up: ↓ 24 Changed 3 years ago by cowboy

+1, I like it, but should we do .removeAttr("foo bar") or .removeAttr("foo", "bar")?

comment:24 in reply to: ↑ 23 Changed 3 years ago by scott.gonzalez

Replying to cowboy:

+1, I like it, but should we do .removeAttr("foo bar") or .removeAttr("foo", "bar")?

"foo bar", consistent with everything

comment:25 Changed 3 years ago by ajpiano

  • Milestone changed from 1.next to 1.7

comment:27 Changed 3 years ago by rwaldron

At this point, whatever, the first is out of date, but that can be fixed. The second is up-to-date, but has no tests and hasn't responded or updated with the tests I provided: (  https://github.com/rwldrn/jquery/commit/bece3a7ab2ae26947634ad57fb08390d55d209fc )

comment:28 Changed 3 years ago by rwaldron

Since no one has responded to my last comment about combining the efforts, I've gone ahead and done so myself.

Current:  https://github.com/jquery/jquery/pull/492/

comment:29 Changed 3 years ago by Rick Waldron

  • Status changed from assigned to closed
  • Resolution set to fixed

Landing pull request 492. 1.7 Remove multiple attributes (Symmetry with removeClass) Combines patches submitted by leeoniya, zertosh and my own tests. Fixes #5479.

More Details:

Note: See TracTickets for help on using tickets.