Select text problem

Hi guys! I have a question for u and i need some help!
Do you know how i can select some text (wich is in an input text) and transfer it with a button to another input text.I dont want to transfer all the value but only the selected value.
TNX !