My requirement is I need to know what value is selected in a text field when right-click on the specific value portion.
e.g. Suppose current value in the text field is “a@a.com, b@b.com, c@c.com”, when I move the mouse over “b@b.com” and right click, program should know I have chosen that email address.
I already implemented it for left-click (by checking event.selectionStart), but in Firefox, right-click will not move the edit cursor to the clicked position, so wherever I right click at, the event.selectionStart keeps the same value.
Any idea?
Thanks…
OK. In firefox, event.rangeOffset can be used.