Option value using JavaScript
===

I have a form with the following field:

    <input type="text" name="text" id="text">

I want that JavaScript takes the value of the field, so I think I should use the following code:

    <script language="javascript">
        function GetTextBoxValue(text)

        {

            alert(document.getElementById(text).value);

        }
    //-->
    </script>

This code has to change the value of a drop-down option.

    <option value="value from JavaScript/text from the textbox">other</option>

Is that possible that text from the textbox is the value of the option? If yes, what I have to write here option value="value from JavaScript" so it would work correctly?