Skip to main content

Bug Tracker

Side navigation

#15223 closed bug (migrated)

Opened August 31, 2014 01:12PM UTC

Closed October 21, 2014 12:59AM UTC

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/

Attachments (0)
Change History (2)

Changed September 01, 2014 01:37AM UTC by brianpow comment:1

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

Changed October 21, 2014 12:59AM UTC by m_gol comment:2

resolution: → migrated
status: newclosed