Bug Tracker

Opened 5 years ago

Closed 5 years ago

#15223 closed bug (migrated)

Cannot select the text in input field under IE11 using jquery onfocus event

Reported by: brianpow Owned by:
Priority: undecided Milestone: None
Component: event Version: 1.11.1
Keywords: Cc:
Blocked by: Blocking:

Description

Background

I plan to select the whole text inside an input field if user focus on the field.

Enivronment

IE11 under Win 7 64 bits

FF31 under Win7 64 bits

Method

$(function(){
jQuery(document).on('focus',XXX) 
});

function XXX{
this.select();
}

Result

IE11: jQuery.on does NOT work. The text is not selected. But if I use addEventListener instead, it works well.

FF31: Both jQuery.on or addEventListener work

Test Case

http://jsfiddle.net/34e2h09t/25/

Change History (2)

comment:1 Changed 5 years ago by brianpow

Assume you focus the text field by mouse click, not by TAB key

comment:2 Changed 5 years ago by m_gol

Resolution: migrated
Status: newclosed
Note: See TracTickets for help on using tickets.