jquery / jquery/api.jquery.com

Clarify .on() documentation for binding to elements that are removed and re-added.

Open
#632 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
325
Forks
260
PR merge metrics
No merged PRs in 30d

Description

I see pretty regular confusion surrounding the notion that your binding breaks if the element you bound to was removed from the document (via, say, .remove()) and then re-added (like when you create a new element with $()).

Might be worthwhile to add in some language that explains why and how to resolve.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the .on() API documentation and review the existing explanation of bindings when elements are removed and later recreated with $(). Clarify why the binding no longer applies and describe how to resolve that situation. Done means the documented behavior and resolution address the reported confusion.

Written by the indexing model from the issue text.

Assessment

Tech stack
jquery
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.