It appears getSelection
does not work on text selected in form fields due to this Firefox bug.
As explained in this answer, the workaround is to use selectionStart
and selectionEnd
instead.
Here is a modified example that works correctly:
It appears getSelection
does not work on text selected in form fields due to this Firefox bug.
As explained in this answer, the workaround is to use selectionStart
and selectionEnd
instead.
Here is a modified example that works correctly: