Getting selected option from the select element

Getting selected option from the select element

I have a few selects like this:  
  1. <select id="theOptions1" name="theOptions1">
    <option>1</option>
    <option>2</option>
    <option>3</option>
    <option>a</option>
    <option>b</option>
    <option>c</option>
    </select>
I want to pass it to a function that will show me the selected element:


  1. $(function() {
    $('#theOptions' + 2)).filterOn('#theOptions' +1, {
    'a': ['a'],
    '1': ['1']
    });
    });
     
here is a part of the function:

  1. jQuery.fn.filterOn = function(radio, values) {
    return this.each(function() {
    var select = this;
    var options = [];
    });
    $(radio).change(function() {
    var selectedIndex = $(radio 'option:selected()').Index();
    alert("and the text is:" + selectedIndex);
    });
    });
    });
    };
but 
  1. alert("and the text is:" + selectedIndex);
doen't seem to work. Is it the right syntax?

  1. var selectedIndex = $(radio 'option:selected()').Index();