Opened 12 years ago
Closed 12 years ago
#10927 closed bug (invalid)
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
*/
Change History (2)
comment:1 Changed 12 years ago by
Owner: | set to Sap |
---|---|
Status: | new → pending |
comment:2 Changed 12 years ago by
Resolution: | → invalid |
---|---|
Status: | pending → closed |
The example there isn't using event delegation at all. Please ask for help on the forum.
Note: See
TracTickets for help on using
tickets.
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.