Skip to main content

Bug Tracker

Side navigation

#10927 closed bug (invalid)

Opened November 30, 2011 10:04AM UTC

Closed November 30, 2011 07:10PM UTC

on is not replacing live properly

Reported by: Sap Owned by: Sap
Priority: undecided Milestone: None
Component: unfiled Version: 1.7.1
Keywords: Cc:
Blocked by: Blocking:
Description

$(document).ready(function(){

$(document).on("click", function(){

if($("#fucsr").attr("id")!="fucsr") {

$('body').append("<input type='text' id='fucsr' name='fucsr' value=''/>");

}

$("#fucsr").focus();

});

$("#fucsr").on("click", function(){

alert("clicked");

});

});

/*

  • This example is working with live but not with on

*/

Attachments (0)
Change History (2)

Changed November 30, 2011 01:15PM UTC by sindresorhus comment:1

owner: → Sap
status: newpending

Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket.

Additionally, be sure to test against the jQuery Edge version to ensure the issue still exists. To get you started, use this boilerplate: http://jsfiddle.net/FrKyN/ Open the link and click to "Fork" (in the top menu) to get started.

Changed November 30, 2011 07:10PM UTC by dmethvin comment:2

resolution: → invalid
status: pendingclosed

The example there isn't using event delegation at all. Please ask for help on the forum.