Skip to main content

Bug Tracker

Side navigation

#5057 closed bug (invalid)

Opened August 16, 2009 05:21AM UTC

Closed August 27, 2009 01:39PM UTC

html('') remove all the children's events

Reported by: agate Owned by:
Priority: major Milestone: 1.4
Component: core Version: 1.3.2
Keywords: html event Cc:
Blocked by: Blocking:
Description

$.html(val) will remove all children nodes. and all the events which bind on these children nodes.

but if i use DOM.innerHTML = val, the children's events will be kept. so that i can use append function to append the children back to the dom tree. and the children's evnets still can be triggered.

Attachments (1)
  • index.html (2.9 KB) - added by agate August 16, 2009 05:22AM UTC.

    jquery html() remove all the children's events

Change History (1)

Changed August 27, 2009 01:39PM UTC by scottgonzalez comment:1

resolution: → invalid
status: newclosed

Using .innerHTML destroys and recreates the DOM; therefore it does remove existing events.