Bug Tracker

Opened 8 years ago

Closed 8 years ago

#12029 closed bug (invalid)

on() not the same as live() for keypress event

Reported by: TrumpetGod@… Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.7.2
Keywords: Cc:
Blocked by: Blocking:


The documentation states on() should be used in place of live for jquery 1.7.

For newly added elements, the 'click' event is working as of 1.7.2 (was broken in previous versions), but 'keypress' does not work with on() (works with live()).

$("input").live( 'keypress', function(event) {
	if ( event.which == 13 ) {
$("input").on( 'keypress', function(event) {
	if ( event.which == 13 ) {
		alert("doesn't work");

Change History (1)

comment:1 Changed 8 years ago by mikesherov

Resolution: invalid
Status: newclosed

Please ask for help on the forums; You're using .on incorrectly.

Note: See TracTickets for help on using tickets.