Say you have two inputs:
<input id="input1" type="text"/>
and <input id="input2" type="text"/>
such that through some JavaScript magic, anything you type in input1 will also be put in input2. In this sense input2 "mirrors" input1.
Is there a way that I can also "mirror" text selection. So if I select some text in input1, how can I have the exact same text in input2 also be selected?
I've been looking at Microsoft's TextRange object and the Selection object used by Mozilla et al, but the whole mess seems pretty cumbersome. Has anyone had any success doing something like this before?
CLARIFICATION: Thanks for the responses so far. To be clear: I'm not asking how to mirror the text. I've already solved that one. The question is only about selecting the text in input1 and having the corresponding text in input2 also be selected.