Bug Tracker

Opened 12 years ago

Closed 12 years ago

Last modified 10 years ago

#8678 closed bug (worksforme)

.focus not working in Firefox 4

Reported by: anonymous Owned by:
Priority: low Milestone: 1.next
Component: event Version: 1.5.1
Keywords: Cc:
Blocked by: Blocking:


$('#textbox').focus(); does not seem to work in Firefox 4. I have tested a script with this in Chrome, and it works OK. This is probably a Firefox 4 issue, not necessarily a jQuery one?

Change History (7)

comment:1 Changed 12 years ago by addyosmani

Priority: undecidedlow
Resolution: worksforme
Status: newclosed

Thanks for submitting a ticket to the jQuery Bug Tracker .focus() is working fine for me in FF4 without any issues. Depending on what you are trying to achieve, see here for a live example where clicking on a link set to focus the input textbox is working fine. http://jsfiddle.net/addyosmani/NmZ6z/. You'll notice that the focus handler is called with a message being appended to the document body, confirming that everything is working as expected.

Last edited 12 years ago by addyosmani (previous) (diff)

comment:2 Changed 12 years ago by [email protected]

My problem is that I have a textbox intended to hold numeric characters, if the user types a non-numeric character I will alert and focus back on the field. I'm using the jquery blur() event to put focus back on the field and it doesn't work.

comment:4 Changed 12 years ago by timmywil

Component: unfiledevent

comment:5 Changed 10 years ago by [email protected]

This bugs announced "working for me" is based on invalid usage. In focus() does not work if the controlling function is blur. In the following code the focus in not set to the originating text box if another text box is clicked on to trigger the blur()

$("#textbox").blur(function () {

$('body').append('focused on textbox');

if($("#textbox").val() > 24 ) {

alert('stop'); $("#textbox").focus(); return false;



comment:6 Changed 10 years ago by anonymous

Here's a jsfiddle of the problem


comment:7 Changed 10 years ago by [email protected]

Sorry about that. The url pasted was not correct


Note: See TracTickets for help on using tickets.