I\'ve been some testing reserching for this other question, when I noticed something very peculiar. FF4/5 fail to fire the focus
jQuery event. The other questio
The focus seems to work now in the latest Firefox without the need of the setTimeout function.
If you want to also select the input field you will have to make use of the .select() function though as document.execCommand('SelectAll'); doesn't seem to work on Firefox either.
So having the input field first focused and then selected you then can copy it or do whatever you want with it.
In my use case I required to copy the url from the input field if someone pressed on the copy button:
$(".copyURL").click(function(){
$(this).prev().focus().select();
document.execCommand("Copy",false,null);
});
I hope this could help anyone else who's searching for this problem!